diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.1.2.pg b/Contrib/Piedmont/MathPlacementTest/mpt.1.2.pg new file mode 100644 index 0000000000..7ebd324773 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.1.2.pg @@ -0,0 +1,69 @@ +#DESCRIPTION +## Algebra problem: simplifying fraction +##ENDDESCRIPTION + +## hcao tagged and PAID on 12-12-2003 + +## slightly modified for Piedmont placement test +## (smaller numbers) by Doug Torrance (2025-05-08) + +## DBsubject(Arithmetic) +## DBchapter(Fractions/rational numbers) +## DBsection(Multiple operations) +## MLT(DivFollowedBySubtract) +## MLTleader(1) +## Date(6/3/2002) +## Level(2) +## TitleText1('College Algebra') +## AuthorText1('Stewart, Redlin, Watson') +## EditionText1('3') +## Section1('1.2') +## Problem1('15') +## KEYWORDS('algebra', 'fraction') +DOCUMENT(); # This should be the first executable line in the problem. + +loadMacros( + "PGstandard.pl", + "PGchoicemacros.pl", + "PGcourse.pl" +); +TEXT(beginproblem()); +$showCorrectPartialAnswers = 1; + +$n1 = random(2,5,1); +$n2 = random(1,5,1); +do {$d2 = random(2,5,1)} until (gcd($n2, $d2) == 1); + +BEGIN_TEXT +Combine the fractions, and reduce your answer. + \[ \left($n1\div\frac{$n2}{$d2}\right)-\frac{$n2}{$d2} \] +The reduced answer is \{ans_rule(5)\} / \{ans_rule(5)\} +END_TEXT +@factors = (); +@commonfactors = (); +$fac = $d2*$n2; +for($i=2; $i<=($d2*$n2)/2; $i++){ + if($fac % $i == 0){ + $fac =$fac/$i; + push @factors,$i; + $i = $i-1; + }; +}; +$fac = $n1*$d2*$d2-$n2*$n2; +foreach $i (@factors){ + if($fac % $i == 0){ + $fac = $fac / $i; + push @commonfactors,$i; + }; +}; +$den = $d2*$n2; +$num = $n1*$d2*$d2-$n2*$n2; +foreach $i (@commonfactors){ + $num = $num / $i; + $den = $den / $i; +}; + +ANS(num_cmp($num, mode=>"strict")); +ANS(num_cmp($den, mode=>"strict")); + +ENDDOCUMENT(); # This should be the last executable line in the problem. diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.1.6.pg b/Contrib/Piedmont/MathPlacementTest/mpt.1.6.pg new file mode 100644 index 0000000000..25605c4c09 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.1.6.pg @@ -0,0 +1,54 @@ +## DESCRIPTION +## Solve a linear inequality +## ENDDESCRIPTION + +## KEYWORDS('linear inequality') + +## DBsubject('Algebra') +## DBchapter('Algebra of real numbers and simplifying expressions') +## DBsection('Inequalities and intervals') +## Date('2025-05-06') +## Author('Doug Torrance') +## Institution('Piedmont University') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "PGML.pl", # PGML markup and Math Objects + "PGcourse.pl", # Customization file for the course +); + +$endpoint = random(-5, 5); +$oper = random(0, 3); +$opertex = ("<", "\leq", ">", "\geq")[$oper]; +$b = random(1, 10); +$c = random(2, 10); +$d = random(1, $endpoint + 10); +$e = $b - $c*($endpoint - $d); + +Context()->variables->add(a => 'Real'); +$f = Formula("$b - $c(a - $d)"); + +if ($oper == 0) { + $ans = Interval("($endpoint, inf)"); +} elsif ($oper == 1) { + $ans = Interval("[$endpoint, inf)"); +} elsif ($oper == 2) { + $ans = Interval("(-inf, $endpoint)"); +} else { + $ans = Interval("(-inf, $endpoint]"); +} + +BEGIN_PGML + +Solve this inequality. + +[``[$f] [$opertex] [$e]``] + +Enter your answer using interval notation. See [@helpLink('interval notation')@]*. + +[_]{$ans} +END_PGML + +ENDDOCUMENT(); diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.1.7.pg b/Contrib/Piedmont/MathPlacementTest/mpt.1.7.pg new file mode 100644 index 0000000000..ada82a1fe3 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.1.7.pg @@ -0,0 +1,191 @@ +# 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 + +# Modified for Piedmont placement test +# (smaller numbers, no sqrt note) +# by Doug Torrance (2025-05-08) + +## 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", + "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)>20) or abs($b * $d) > 20) +{ + $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); +$ans = Compute("$var = $soln1, $var = $soln2"); + +############################################## + +TEXT(beginproblem()); +BEGIN_PGML +Solve the equation. + + [` [$lhs]=[$rhs]`] + + [__________________________] + +[@KeyboardInstructions("Enter multiple answers separated by commas, as in [|x=1, x=-1|]*.")@]** +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], +))); + +############################################## + +$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/Contrib/Piedmont/MathPlacementTest/mpt.1.8.pg b/Contrib/Piedmont/MathPlacementTest/mpt.1.8.pg new file mode 100644 index 0000000000..3490b18531 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.1.8.pg @@ -0,0 +1,51 @@ +## DESCRIPTION +## Simplify radical expression +## ENDDESCRIPTION + +## KEYWORDS('radical expression') + +## DBsubject('Algebra') +## DBchapter('Properties of exponents, rational exponents and radicals') +## DBsection('Properties of rational exponents and radicals') +## Date('2025-05-07') +## Author('Doug Torrance') +## Institution('Piedmont University') + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "PGML.pl", # PGML markup and Math Objects + "PGcourse.pl", # Customization file for the course + "contextLimitedRadical.pl", +); + +# constant term = a^2 * b, where a and b are chosen from 2, 3, 5 +$a = list_random(2, 3, 5); +do {$b = list_random(2, 3, 5);} until ($a != $b); +$coeff = $a**2 * $b; + +$var_with_exp = random(0, 1); +$a_exp = random(2, 4); +$q_exp = 2 * $a_exp + 1; + +Context('LimitedRadical'); +Context()->variables->add(y => 'Real'); + +if ($var_with_exp == 0) { + $q = Formula("sqrt($coeff x^$q_exp y)"); + $ans = Formula("$a x^$a_exp sqrt($b x y)"); +} else { + $q = Formula("sqrt($coeff x y^$q_exp)"); + $ans = Formula("$a y^$a_exp sqrt($b x y)"); +} + +BEGIN_PGML +Simplify this expression. Assume all variables represent positive real numbers. + +[``[$q]``]. + +[_]{$ans} +END_PGML + +ENDDOCUMENT(); diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.1.9.pg b/Contrib/Piedmont/MathPlacementTest/mpt.1.9.pg new file mode 100644 index 0000000000..e78a8af914 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.1.9.pg @@ -0,0 +1,126 @@ +## DESCRIPTION +## Exponent rules +## ENDDESCRIPTION + +# Modified for Piedmont placement test (fewer +# parts) by Doug Torrance (2025-05-08) + +## DBsubject(Arithmetic) +## DBchapter(Integers) +## DBsection(Exponentiation) +## Date(01/01/10) +## Institution(Fort Lewis College) +## Author(Paul Pearson) +## Level(2) +## MO(1) +## TitleText1('Functions Modeling Change') +## TitleText2('Functions Modeling Change') +## TitleText3('Functions Modeling Change') +## AuthorText1('Connally') +## AuthorText2('Connally') +## AuthorText3('Connally') +## EditionText1('3') +## EditionText2('4') +## EditionText3('5') +## Section1(3.Tools) +## Section2('4.Skills') +## Section3('4.Skills') +## Problem1(21 22 26) +## Problem2(16 19) +## Problem3(16 19) +## KEYWORDS('exponents') + + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl", + "PGcourse.pl", + "contextLimitedNumeric.pl", + "contextLimitedFactor.pl", + "contextFraction.pl", +); + +TEXT(beginproblem()); + +############################################## +# Setup + +Context("LimitedNumeric"); + +$a1 = random(-5,-3,1); +$b1 = random(3,5,1); +$answera = Real($a1 * $b1**2); + +$a2 = random(3,7,1); +$b2 = random(3,7,1); +$answerb = Real("1"); + +$a3 = random(2, 9.9, 0.1); +$c3 = random(3,5,1); +$answerc = Real($a3 * 10**($c3)); + +Context("LimitedFactor"); +Context()->variables->add(y => 'Real'); + +$db = random(2, 10); +$da = $db * random(2, 10); +$dc = random(2, 10); +$dd = $dc + random(2, 10); +$de = random(2, 10); +$df = random(2, 10); +$answerd = Formula($da/$db . "y^" . ($de + $df) . "/x^" . ($dd - $dc)); + +Context()->variables->add(t => 'Real'); + +$ea = random(2, 10); +do {$eb = random(2, 10)} until (gcd($ea, $eb) == 1); +$ec = random(2, 10); +$answere = Formula("$ea t^2 / (" . ($eb**2) . "x^" . (2*$ec) . ")"); + +Context("LimitedFraction"); +$a = random(2,4,1); +$aaa = $a**3; + +$b = random(2,4,1); +while ($b==$a) { $b=random(2,4,1); } +$bbb = $b**3; + +$answerf = Fraction("$b","$a"); + +############################################## +# Main text + +Context()->texStrings; +BEGIN_TEXT + +Evaluate the following without a calculator. +Simplify your answers as much as possible, without using negative exponents. Do not include commas in any large numbers. +$BR +$BR +(a) \( ($a1)\cdot$b1^2 = \) +\{ans_rule(10)\} +$BR +$BR +(b) \( \displaystyle \left( \frac{$aaa}{$bbb} \right)^{-1/3} = \) +\{ans_rule(10)\} +$BR +$BR +(c) \(\dfrac{$da x^{$dc}y^{$de}}{$db x^{$dd}y^{-$df}} = \) +\{ans_rule(10)\} + +END_TEXT + +################################################## +# Answer evaluation + +#install_problem_grader(~~&std_problem_grader); + +$showPartialCorrectAnswers = 1; + +ANS($answera->cmp()); +ANS($answerf->cmp()); +ANS($answerd->cmp()); + +ENDDOCUMENT(); diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.2.1.pg b/Contrib/Piedmont/MathPlacementTest/mpt.2.1.pg new file mode 100644 index 0000000000..b7d8320114 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.2.1.pg @@ -0,0 +1,42 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 2 +## Problem 1 - Difference quotient +##ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Functions) +## DBsection(Difference quotient) +## Institution(Piedmont) +## Author(Doug Torrance) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", +); + +$b = non_zero_random(-5, 5); +$c = non_zero_random(-5, 5); + +$f = Formula("x^2 + $b x + $c"); + +Context()->variables->add(h => 'Real'); +Context()->operators->undefine("/"); + +$ans = Formula("2x + $b + h"); + +BEGIN_TEXT + +Suppose \(x\) and \(h\) are variables and \(f(x) = \{$f->reduce->TeX\}\). Simplify the following expression. +$PAR + +\(\dfrac{f(x+h)-f(x)}{h}\) = \{ans_rule\} + +END_TEXT + +ANS($ans->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.2.10.pg b/Contrib/Piedmont/MathPlacementTest/mpt.2.10.pg new file mode 100644 index 0000000000..7681927927 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.2.10.pg @@ -0,0 +1,56 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 2 +## Problem 10 - Application of exponential/logarithmic functions (half-life) +##ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Exponential and logarithmic expressions and functions) +## DBsection(Applications and models - radioactive decay) +## Institution(Piedmont) +## Author(Doug Torrance) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" +); + +$half_amount = 8 * random(1, 10); +$initial_amount = 2 * $half_amount; +$half_life = random(1, 10); + +$r = Compute("1/$half_life * ln(1/2)"); + +$t = $half_life * random(2, 4); + +$ans = Compute("$initial_amount * (1/2)^($t/$half_life)"); + +BEGIN_TEXT + +Suppose that an initial amount of $initial_amount g of some radioactive isotype decays to $half_amount g after $half_life hours. +$PAR + +(a) If the amount of of this isotype is modeled by the function \(f(t) = Pe^{rt}\), where \(t\) represents the time in hours, then find the decay constant \(r\). +$PAR + +Do not give a decimal approximation. You may leave your answers in terms of logarithms. +$PAR + +\(r\) = \{ans_rule\} +$PAR + +(b) Determine how much of the isotype remains after $t hours. +$PAR + +\(f($t)\) = \{ans_rule\} g +$PAR + +END_TEXT + +ANS($r->cmp); +ANS($ans->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.2.2.pg b/Contrib/Piedmont/MathPlacementTest/mpt.2.2.pg new file mode 100644 index 0000000000..e0968406e6 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.2.2.pg @@ -0,0 +1,38 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 2 +## Problem 2 - Complete the square (vertex form) +##ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Quadratic equations and functions) +## DBsection(Forms: vertex, factored, general) +## Institution(Piedmont) +## Author(Doug Torrance) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", +); + +$h = non_zero_random(-10, 10); +$k = non_zero_random(-10, 10); + +$f = Formula("x^2 + " . (-2*$h) . "x + " . ($h**2 + $k)); + +BEGIN_TEXT + +Consider the parabola \(y = \{$f->reduce->TeX\}\). Complete the square to find its equation in vertex form. +$PAR + +\(y\) = \((x - \)\{ans_rule\}\()^2 + \)\{ans_rule\} + +END_TEXT + +ANS(Compute($h)->cmp); +ANS(Compute($k)->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.2.3.pg b/Contrib/Piedmont/MathPlacementTest/mpt.2.3.pg new file mode 100644 index 0000000000..0db8a15632 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.2.3.pg @@ -0,0 +1,92 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 2 +## Problem 3 - Transformation of parabola +##ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Quadratic equations and functions) +## DBsection(Graphs) +## Institution(Piedmont) +## Author(Doug Torrance) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", + "parserGraphTool.pl" +); + +$gt_checker = sub { + my ($correct, $student, $ans, $value) = @_; + return 0 if $ans->{isPreview}; + + my $score = 0; + my @errors; + my $count = 1; + + my ($h, $k) = $correct->[0]->extract(4)->value; + my ($px, $py) = $correct->[0]->extract(5)->value; + my $a = ($py - $k) / ($px - $h)**2; + + my $pointOnParabola= sub { + my $point = shift; + my ($x, $y) = $point->value; + return $y == $a * ($x - $h)**2 + $k; + }; + + for (@$student) { + my $nth = Value::List->NameForNumber($count++); + + $score += 1, next + if ($_->extract(1) eq $correct->[0]->extract(1) && + $_->extract(3) == $correct->[0]->extract(3) && + $_->extract(4) == $correct->[0]->extract(4) && + $pointOnParabola->($_->extract(5))); + + push(@errors, "The $nth object graphed is not a parabola"), + next if ($_->extract(1) ne $correct->[0]->extract(1)); + + push(@errors, "The $nth parabola graphed should be " . + $correct->[0]->extract(3)), + next if ($_->extract(3) ne $correct->[0]->extract(3)); + + push(@errors, "The $nth parabola graphed should have vertex " . + $correct->[0]->extract(4)), + next if ($_->extract(4) ne $correct->[0]->extract(4)); + + push(@errors, "The $nth parabola graphed should not contain the point " . + $_->extract(5)); + } + + return ($score, @errors); +}; + + +Context()->noreduce('(-x)-y'); + +$sgn = non_zero_random(-1, 1); +$h = non_zero_random(-5, 5); +$k = non_zero_random(-5, 5); +$f = Formula("$sgn*(x - $h)^2 + $k"); + +$y1 = $f->eval(x => $h); +$y2 = $f->eval(x => $h + 1); + +$gt = GraphTool("{parabola, solid, vertical, ($h, $y1), ($h + 1, $y2)}")->with( + cmpOptions => { list_checker => $gt_checker }); + +BEGIN_TEXT + +Sketch the parabola \(y = \{$f->reduce->TeX\}\). +$PAR + +\{$gt->ans_rule()\} + +END_TEXT + +ANS($gt->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.2.4.pg b/Contrib/Piedmont/MathPlacementTest/mpt.2.4.pg new file mode 100644 index 0000000000..f535ecf021 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.2.4.pg @@ -0,0 +1,44 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 2 +## Problem 4 - Polynomial division +##ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Operations on polynomial and rational expressions) +## DBsection(Polynomials: divide) +## Institution(Piedmont) +## Author(Doug Torrance) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", + "parserGraphTool.pl" +); + +$a = non_zero_random(-5, 5); +$b = non_zero_random(-5, 5); +$c = non_zero_random(-5, 5); +$r = non_zero_random(-5, 5); + +$f = Formula("x^3 + " . ($a + $b) . "x^2 + " . ($a * $b + $c) . "x + " . ($a * $c + $r)); +$g = Formula("x + $a"); + +$q = Formula("x^2 + $b x + $c"); + +BEGIN_TEXT + +Find the quotient and remainder when dividing \(\{$f->reduce->TeX\}\) by \(\{$g->reduce->TeX\}\). +$PAR + +\(\{$f->reduce->TeX\}\) = \((\)\{ans_rule\}\()(\{$g->reduce->TeX\}) + \)\{ans_rule\} + +END_TEXT + +ANS($q->cmp); +ANS(Compute($r)->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.2.5.pg b/Contrib/Piedmont/MathPlacementTest/mpt.2.5.pg new file mode 100644 index 0000000000..e934c503cc --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.2.5.pg @@ -0,0 +1,43 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 2 +## Problem 4 - Polynomial division +##ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Polynomial equations and functions) +## DBsection(Polynomial equations) +## Institution(Piedmont) +## Author(Doug Torrance) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl" +); + +$a = non_zero_random(-5, 5); +do {$b = random(1, 5)} until (abs($a) != $b); + +# (x - a)(x - b)(x + b) +$f = Formula("x^3 - $a x^2 - " . $b**2 . "x + " . ($a * $b**2)); + +$roots = List($a, $b, -$b); + +BEGIN_TEXT + +Solve the cubic equation \(\{$f->reduce->TeX\} = 0\). +$PAR + +If there are multiple solutions, then separate them with commas. +$PAR + +\(x\) = \{ans_rule\} + +END_TEXT + +ANS($roots->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.2.6.pg b/Contrib/Piedmont/MathPlacementTest/mpt.2.6.pg new file mode 100644 index 0000000000..17cf3d9a07 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.2.6.pg @@ -0,0 +1,68 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 2 +## Problem 4 - Polynomial division +##ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Polynomial equations and functions) +## DBsection(Inequalities involving polynomials) +## Institution(Piedmont) +## Author(Doug Torrance) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl" +); + +$a = random(-5, -1); +$b = random(1, 5); + +# x^2 * (x - a) * (x - b) +$f = Formula("x^4 - " . ($a + $b) . "x^3 + " . ($a * $b) . "x^2"); + +$roots = List(0, $a, $b); +$pos = Interval("(-infinity, $a) U ($b, infinity)"); +$neg = Interval("[$a, $b]"); + +BEGIN_TEXT + +Consider the quartic polynomial function \(f(x)=\{$f->reduce->TeX\}\). +$PAR + +(a) Find all solutions to the equation \(f(x) = 0\). +$PAR + +If there are multiple solutions, then separate them with commas. If any solution has multiplicity greater than 1, then just enter it once. +$PAR + +\(x\) = \{ans_rule\} +$PAR + +(b) Find all solutions to the inequality \(f(x) > 0\). +$PAR + +Give your answer in \{helpLink('interval')\} notation. +$PAR + +\(x\in\) \{ans_rule\} +$PAR + +(c) Find all solutions to the inequality \(f(x) \leq 0\). +$PAR + +Give your answer in \{helpLink('interval')\} notation. +$PAR + +\(x\in\) \{ans_rule\} + +END_TEXT + +ANS($roots->cmp); +ANS($pos->cmp); +ANS($neg->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.2.7.pg b/Contrib/Piedmont/MathPlacementTest/mpt.2.7.pg new file mode 100644 index 0000000000..1fe4a5ab0d --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.2.7.pg @@ -0,0 +1,64 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 2 +## Problem 7 - Graph of rational function +##ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Rational equations and functions) +## DBsection(Graphs of rational functions) +## Institution(Piedmont) +## Author(Doug Torrance) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" +); + +$a = non_zero_random(-5, 5); +$b = non_zero_random(-5, 5); +do {$c = non_zero_random(-5, 5)} until ($c != $a); + +# x^2 * (x - a) * (x - b) +$f = Formula("($b x - " . ($b * $c) . ") / (x - $a)"); + +BEGIN_TEXT + +Consider the hyperbola \(y=\{$f->reduce->TeX\}\). +$PAR + +(a) Find the vertical asymptote. +$PAR + +\(x\) = \{ans_rule\} +$PAR + +(b) Find the horizontal asymptote. +$PAR + +\(y\) = \{ans_rule\} +$PAR + +(c) Find the \(x\)-intercept. +$PAR + +\(x\) = \{ans_rule\} +$PAR + +(d) Find the \(y\)-intercept. +$PAR + +\(y\) = \{ans_rule\} +$PAR + +END_TEXT + +ANS(Compute($a)->cmp); +ANS(Compute($b)->cmp); +ANS(Compute($c)->cmp); +ANS(Compute($b * $c / $a)->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.2.8.pg b/Contrib/Piedmont/MathPlacementTest/mpt.2.8.pg new file mode 100644 index 0000000000..6262ab98c5 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.2.8.pg @@ -0,0 +1,64 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 2 +## Problem 8 - Evaluate logarithms +##ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Exponential and logarithmic expressions and functions) +## DBsection(Logarithmic functions) +## Institution(Piedmont) +## Author(Doug Torrance) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" +); + +# largest logarithm we might expect a student to do by hand +sub max_log { + my $b = shift; + return 6 if ($b == 2); # 2^6 = 64 + return 4 if ($b == 3); # 3^4 = 81 + return 3 if ($b <= 5); # 4^3 = 64, 5^3 = 125 + return 2; +} + +$b1 = random(2, 9); + +$b2 = random(2, 9); +$e2 = random(2, max_log($b2)); + +$b3 = random(2, 9); +$e3 = random(2, max_log($b3)); + +$b4 = random(2, 9); +$e4 = random(2, max_log($b4)); + +BEGIN_TEXT + +Evaluate the following logarithms. +$PAR + +(a) \(\log_$b1 1\) = \{ans_rule\} +$PAR + +(b) \(\log_$b2 \{$b2 ** $e2\}\)= \{ans_rule\} +$PAR + +(c) \(\log_{\{$b3 ** $e3\}} $b3\) = \{ans_rule\} +$PAR + +(d) \(\log_$b4\frac{1}{\{$b4 ** $e4\}}\) = \{ans_rule\} + +END_TEXT + +ANS(Compute(0)->cmp); +ANS(Compute($e2)->cmp); +ANS(Compute(1/$e3)->cmp); +ANS(Compute(-$e4)->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.2.9.pg b/Contrib/Piedmont/MathPlacementTest/mpt.2.9.pg new file mode 100644 index 0000000000..b9639bee54 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.2.9.pg @@ -0,0 +1,42 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 2 +## Problem 9 - Logarithmic properties +##ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Exponential and logarithmic expressions and functions) +## DBsection(Properties of logarithms) +## Institution(Piedmont) +## Author(Doug Torrance) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", + "MathObjects.pl" +); + +$a = random(2, 9); +$b = random(2, 9); +$c = random(2, 9); + +Context()->variables->add(y => "Real", z => "Real"); + +$f = Compute("$a ln x + $b ln y - $c ln z"); +$ans = Compute("x^$a * y^$b / z^$c"); + +BEGIN_TEXT + +Simplify the expression \(\{$f->reduce->TeX\}\) using a single logarithm. +$PAR + +\(\{$f->reduce->TeX\} = \ln\Bigl(\) \{ans_rule\} \(\Bigr)\) + + +END_TEXT + +ANS($ans->cmp); + +ENDDOCUMENT(); \ No newline at end of file diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.3.1.pg b/Contrib/Piedmont/MathPlacementTest/mpt.3.1.pg new file mode 100644 index 0000000000..d1a470691e --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.3.1.pg @@ -0,0 +1,58 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 3 +## Problem 1 - Function composition +##ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Functions) +## DBsection(Compositions and combinations of functions) +## Author(Shahryar Heydari) +## Author(Doug Torrance) +## Institution(Piedmont) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", +); + +$a = non_zero_random(-5, 5); +$b = non_zero_random(-5, 5); +$c = non_zero_random(-5, 5); +$d = non_zero_random(-5, 5); + +$f = Formula("$a + $b x^2"); +$g = Formula("$c x + $d"); + +$part_a = $f->eval(x => $g->eval(x => 0)); +$part_b = $g->eval(x => $f->eval(x => 0)); +$part_c = $f->substitute(x => $f); +$part_d = $g->substitute(x => $g); + +BEGIN_TEXT + +Suppose \(f(x) = \{$f->reduce->TeX\}\) and \(g(x) = \{$g->reduce->TeX\}\). Find the following +$PAR + +(a) \((f\circ g)(0)\) = \{ans_rule\} +$PAR + +(b) \((g\circ f)(0)\) = \{ans_rule\} +$PAR + +(c) \((f\circ f)(x)\) = \{ans_rule\} +$PAR + +(d) \((g\circ g)(x)\) = \{ans_rule\} + +END_TEXT + +ANS($part_a->cmp); +ANS($part_b->cmp); +ANS($part_c->cmp); +ANS($part_d->cmp); + +ENDDOCUMENT(); diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.3.10.pg b/Contrib/Piedmont/MathPlacementTest/mpt.3.10.pg new file mode 100644 index 0000000000..62a7050b6b --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.3.10.pg @@ -0,0 +1,83 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 3 +## Problem 10 - Transformations of sine curve +##ENDDESCRIPTION + +## DBsubject(Trigonometry) +## DBchapter(Triangle trigonometry) +## DBsection(Applications of special triangles & right triangles) +## Author(Shahryar Heydari) +## Author(Doug Torrance) +## Institution(Piedmont) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", + "parserRadioButtons.pl", + "PGgraphmacros.pl", + "PGchoicemacros.pl" +); + +sub func_str { + my ($a, $b, $c) = @_; + return "$a * sin(pi * x /$b) + $c"; +} + +sub sketch_graph { + my $str = shift; + my $gr = init_graph(-10, -10, 10, 10, axes => [0, 0], grid => [20, 20], size => [400, 400]); + add_functions($gr, "$str for x in <-10, 10> using color:blue"); + return $gr; +} + +$a = non_zero_random(-5, 5); +$b = random(2, 5); +$c = non_zero_random(-5, 5); + +$fstr = func_str($a, $b, $c); +$f = Compute($fstr); + +@strings = ($fstr, func_str($a, $b, -$c), func_str(-$a, $b, $c), func_str(-$a, $b, -$c))[shuffle(4)]; + +@options = ['(i)', '(ii)', '(iii)', '(iv)']; +$correct = 0; +while ($strings[$correct] ne $fstr) { + $correct++; +} + +@gr = (); +for ($i = 0; $i < 4; $i++) { + push(@gr, sketch_graph($strings[$i])); +} + +$buttons = RadioButtons(@options, $correct); + +BEGIN_TEXT + +Identify the graph of the curve \(y = \{$f->reduce->TeX\}\). +$PAR + + +(i) \{ image(insertGraph($gr[0]), width => 400, height => 400)\} +$PAR + +(ii) \{ image(insertGraph($gr[1]), width => 400, height => 400)\} +$PAR + +(iii) \{ image(insertGraph($gr[2]), width => 400, height => 400)\} +$PAR + +(iv) \{ image(insertGraph($gr[3]), width => 400, height => 400)\} +$PAR + +\{$buttons->buttons\} + +END_TEXT + +ANS($buttons->cmp); + +ENDDOCUMENT(); diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.3.2.pg b/Contrib/Piedmont/MathPlacementTest/mpt.3.2.pg new file mode 100644 index 0000000000..46a11cf288 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.3.2.pg @@ -0,0 +1,40 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 3 +## Problem 2 - Inverse functions +##ENDDESCRIPTION + +## DBsubject(Algebra) +## DBchapter(Functions) +## DBsection(Compositions and combinations of functions) +## Author(Shahryar Heydari) +## Author(Doug Torrance) +## Institution(Piedmont) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", +); + +$a = non_zero_random(-9, 9); +$b = non_zero_random(-9, 9); +$c = non_zero_random(-9, 9); + +$f = Formula("($a + $b x) / $c"); +$finv = Formula("($c x - $a) / $b"); + +BEGIN_TEXT + +Suppose \(f(x) = \{$f->reduce->TeX\}\). Find the inverse of \(f\). +$PAR + +\(f^{-1}(x)\) = \{ans_rule\} + +END_TEXT + +ANS($finv->cmp); + +ENDDOCUMENT(); diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.3.3.pg b/Contrib/Piedmont/MathPlacementTest/mpt.3.3.pg new file mode 100644 index 0000000000..f24074844a --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.3.3.pg @@ -0,0 +1,49 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 3 +## Problem 2 - Inverse functions +##ENDDESCRIPTION + +## DBsubject(Trigonometry) +## DBchapter(Analytic trigonometry) +## DBsection(Using and proving basic identities) +## Author(Shahryar Heydari) +## Author(Doug Torrance) +## Institution(Piedmont) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", + "contextFraction.pl" +); + +$opp = non_zero_random(-9, 9); +$adj = non_zero_random(-9, 9); +$hyp = sqrt($opp**2 + $adj**2); + +Context("Fraction"); +$tan = Compute("$opp / $adj"); +$ineq = ($opp > 0) ? ">" : "<"; + +$cos = Compute("$adj / $hyp"); +$sin = Compute("$opp / $hyp"); + +BEGIN_TEXT + +If \(\tan\theta = \{$tan->TeX\}\) and \(\sin\theta $ineq 0\), then find the following. +$PAR + +(a) \(\cos\theta\) = \{ans_rule\} +$PAR + +(b) \(\sin\theta\) = \{ans_rule\} + +END_TEXT + +ANS($cos->cmp); +ANS($sin->cmp); + +ENDDOCUMENT(); diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.3.4.pg b/Contrib/Piedmont/MathPlacementTest/mpt.3.4.pg new file mode 100644 index 0000000000..04773f0698 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.3.4.pg @@ -0,0 +1,88 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 3 +## Problem 2 - Inverse functions +##ENDDESCRIPTION + +## DBsubject(Trigonometry) +## DBchapter(Analytic trigonometry) +## DBsection(Using and proving basic identities) +## Author(Shahryar Heydari) +## Author(Doug Torrance) +## Institution(Piedmont) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", + "contextFraction.pl" +); + +Context("Fraction"); + +sub pretty_sqrt { + my $x = shift; + if ($x == 1 || $x == 4 || $x == 9 || $x == 16) { + return sqrt($x); + } elsif ($x % 4 == 0) { + return "2\sqrt " . ($x / 4); + } elsif ($x == 18) { + return "3\sqrt 2"; + } else { + return "\sqrt $x"; + } +} + +sub pretty_frac { + my $frac = shift; + my $sgn = shift; + my ($num, $den) = $frac->value; + my $result = "\frac{" . pretty_sqrt($num) . "}{ " . pretty_sqrt($den) . "}"; + if ($sgn < 0) { + $result = "-" . $result; + } + return $result; +} + +$a = random(1, 9); +$b = random(1, 9); +$c = $a + $b; + +$cossgn = non_zero_random(-1, 1); +$sinsgn = non_zero_random(-1, 1); + +$cos2 = Compute("$a / $c"); +$sin2 = Compute("$b / $c"); + +$cosstr = pretty_frac($cos2, $cossgn); +$sinstr = pretty_frac($sin2, $sinsgn); + +$cos = Compute("$cossgn * sqrt($a / $c)"); +$sin = Compute("$sinsgn * sqrt($b / $c)"); +$tan = Compute("$cossgn * $sinsgn * sqrt($b / $a)"); + +BEGIN_TEXT + +Suppose the angle \(\theta\) in standard position meets the unit circle at \(\left($cosstr, $sinstr\right)\). +$PAR + +Find the following. +$PAR + +(a) \(\cos\theta\) = \{ans_rule\} +$PAR + +(b) \(\sin\theta\) = \{ans_rule\} +$PAR + +(c) \(\tan\theta\) = \{ans_rule\} + +END_TEXT + +ANS($cos->cmp); +ANS($sin->cmp); +ANS($tan->cmp); + +ENDDOCUMENT(); diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.3.5.pg b/Contrib/Piedmont/MathPlacementTest/mpt.3.5.pg new file mode 100644 index 0000000000..849945898c --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.3.5.pg @@ -0,0 +1,44 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 3 +## Problem 2 - Inverse functions +##ENDDESCRIPTION + +## DBsubject(Trigonometry) +## DBchapter(Analytic trigonometry) +## DBsection(Using and proving general identities) +## Author(Shahryar Heydari) +## Author(Doug Torrance) +## Institution(Piedmont) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", +); + +$a = random(1, 9); +$b = random(1, 9); +$c = random(1, 9); +$d = random(1, 9); + +$orig = Compute("($a + $b sin x) / ($c - $d sin x)"); + +Context()->functions->disable("Trig"); +Context()->functions->redefine("csc"); +$ans = Compute("($a csc x + $b) / ($c csc x - $d)"); + +BEGIN_TEXT + +Find an expression involving only \(\csc x\) that is equal to \(\{$orig->reduce->TeX\}\). +$PAR + +\(\{$orig->reduce->TeX\}\) = \{ans_rule\} + +END_TEXT + +ANS($ans->cmp); + +ENDDOCUMENT(); diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.3.6.pg b/Contrib/Piedmont/MathPlacementTest/mpt.3.6.pg new file mode 100644 index 0000000000..2aa150e16f --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.3.6.pg @@ -0,0 +1,43 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 3 +## Problem 6 - Trigonmetric identities +##ENDDESCRIPTION + +## DBsubject(Trigonometry) +## DBchapter(Analytic trigonometry) +## DBsection(Using and proving general identities) +## Author(Shahryar Heydari) +## Author(Doug Torrance) +## Institution(Piedmont) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", +); + +$a = random(1, 9); +$b = non_zero_random(-9, 9); + +$orig = Compute("($a tan x + $b cot x)^2"); + +Context()->functions->disable("Trig"); +Context()->functions->redefine("sec"); +Context()->functions->redefine("csc"); +$ans = Compute("$a^2 (sec x)^2 + ($b)^2 (csc x)^2 - ($a - $b)^2"); + +BEGIN_TEXT + +Find an expression involving only \(\sec x\) and/or \(\csc x\) that is equal to \(\{$orig->reduce->TeX\}\). +$PAR + +\(\{$orig->reduce->TeX\}\) = \{ans_rule\} + +END_TEXT + +ANS($ans->cmp); + +ENDDOCUMENT(); diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.3.7.pg b/Contrib/Piedmont/MathPlacementTest/mpt.3.7.pg new file mode 100644 index 0000000000..206f56340e --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.3.7.pg @@ -0,0 +1,43 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 3 +## Problem 7 - Trigonmetric equations +##ENDDESCRIPTION + +## DBsubject(Trigonometry) +## DBchapter(Analytic trigonometry) +## DBsection(Solving trigonometric equations exactly) +## Author(Shahryar Heydari) +## Author(Doug Torrance) +## Institution(Piedmont) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", +); + +$a = non_zero_random(-9, 9); +do {$b = non_zero_random(-9, 9)} until ($a + $b != 0); + +$x = non_zero_random(-1, 1); + +$lhs = Compute("$b cos x + " . ($a * $x + $a + $b)); +$rhs = Compute(($a + $b) . "(cos x + 1)"); + +$ans = Compute(-90 * ($x - 1)); + +BEGIN_TEXT + +Solve \(\{$lhs->reduce->TeX\} = \{$rhs->reduce->TeX\}\), \(0^\circ \leq x < 360^\circ\). +$PAR + +\(x\) = \{ans_rule\}\(^\circ\) + +END_TEXT + +ANS($ans->cmp); + +ENDDOCUMENT(); diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.3.8.pg b/Contrib/Piedmont/MathPlacementTest/mpt.3.8.pg new file mode 100644 index 0000000000..279076c259 --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.3.8.pg @@ -0,0 +1,45 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 3 +## Problem 8 - Trigonmetric equations +##ENDDESCRIPTION + +## DBsubject(Trigonometry) +## DBchapter(Analytic trigonometry) +## DBsection(Solving trigonometric equations exactly) +## Author(Shahryar Heydari) +## Author(Doug Torrance) +## Institution(Piedmont) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", +); + +$a = non_zero_random(-1, 1); +$b = random(-1, 1); + +$rhs = Compute(($a + 2*$b) . "sin x - " . ($a * $b)); + +$ans1 = Compute("$a * pi/6"); +$ans2 = Compute("$b * pi/2"); +$ans = List($ans1, $ans2); + +BEGIN_TEXT + +Solve \(2\sin^2 x = \{$rhs->reduce->TeX\}\), \(-\frac{\pi}{2}\leq x \leq\frac{\pi}{2}\). +$PAR + +If there are multiple solutions, then separate them with a comma. +$PAR + +\(x\) = \{ans_rule\} + +END_TEXT + +ANS($ans->cmp); + +ENDDOCUMENT(); diff --git a/Contrib/Piedmont/MathPlacementTest/mpt.3.9.pg b/Contrib/Piedmont/MathPlacementTest/mpt.3.9.pg new file mode 100644 index 0000000000..4ba8cba45a --- /dev/null +++ b/Contrib/Piedmont/MathPlacementTest/mpt.3.9.pg @@ -0,0 +1,38 @@ +##DESCRIPTION +## Piedmont Math Placement Test Part 3 +## Problem 9 - Right triangle trigonometry +##ENDDESCRIPTION + +## DBsubject(Trigonometry) +## DBchapter(Triangle trigonometry) +## DBsection(Applications of special triangles & right triangles) +## Institution(Piedmont) +## Author(Doug Torrance) + +######################################################################## + +DOCUMENT(); + +loadMacros( + "PGstandard.pl", # Standard macros for PG language + "MathObjects.pl", +); + +# 30/60/90 or 45/45/90 right triangle +$angleA = 15 * random(2, 4); +$angleB = 90 - $angleA; +$sideAB = random(1, 20); +$sideBC = Compute("$sideAB * sin($angleA * pi/180)"); + +BEGIN_TEXT + +In a triangle \(ABC\) with \(m\angle A = $angleA^\circ\), \(m\angle B = $angleB^\circ\), and \(AB = $sideAB\), find \(BC\). +$PAR + +\(BC\) = \{ans_rule\} + +END_TEXT + +ANS($sideBC->cmp); + +ENDDOCUMENT();