Here is our current version of beth1polyfun. Our only claim on authoring this problem is that Beth is here. ##DESCRIPTION ## Algebra problem: complex roots of a polynomial ##ENDDESCRIPTION
##KEYWORDS('algebra', 'polynomial function', 'zero')
DOCUMENT(); # This should be the first executable line in the problem.
loadMacros( PG.pl, PGbasicmacros.pl, PGchoicemacros.pl, PGanswermacros.pl, PGauxiliaryFunctions.pl, PGasu.pl, extraAnswerEvaluators.pl, PGcomplexmacros.pl );
TEXT(&beginproblem); $showPartialCorrectAnswers = 1;
$a = non_zero_random(-5,-1,1); $b = non_zero_random(1,5,1); # (x-a)(x-b)(x^2+2) $b1=-($a+$b); $c1=$a*$b+2; $d1=-2*($a+$b); $e1=2*$a*$b;
$p = nicestring([1,$b1, $c1, $d1, $e1]); $p="P(x)=$p ";
BEGIN_TEXT Find $BBOLD all $EBOLD of the zeros of the following polynomial and give them in a comma-separated list. If there are no zeros, enter $BITALIC None$EITALIC. [$p] $BR Its zeros are: { ans_rule(40) } $BR $BR $BBOLD Note: $EBOLD complex numbers should be in the form (a+bi).
END_TEXT
ANS(number_list_cmp("$a, $b, sqrt(2)*i, -sqrt(2)*i", complex=>'ok', strings=>['none']));
ENDDOCUMENT(); # This should be the last executable line in the problem.
I think the most recent change was the note about the form of the
answers. Webwork would choke on "sqrt(-2)" and "-sqrt(-2)". In fact, we
may revise this problem to use the new parser which can handle answers
in that form.
John
<| Post or View Comments |>
|