I am writing a problem relating to the First Derivative Test. The first answer is to be a list of numbers representing the critical points. The second answer is to be a list of "+" or "-" corresponding to the sign of the first derivative on intervals created by these critical points.

If I add "+" and "-" as strings to the context, the first answer breaks for negative numbers: "Operands of "*" can't be words"

If I do not add them as strings, the list checker complains that "+" or "-" are missing operands.

Ideas?

Thanks,

D. Brian Walton

James Madison University

Here is an example of how to do it:

loadMacros("contextString.pl"); Context("Numeric"); $critpts = Compute("-2.7, 1.5, 3.53"); Context("String")->strings->add("+"=>{}, "-"=>{}, "0"=>{}); # define the allowed strings Context()->operators->redefine(",", from=>"Numeric"); # allow lists $signs = Compute("+,-,+,-"); BEGIN_TEXT The critical points are: \{ans_rule(20)\}$BR The signs of the intervals between them are \{ans_rule(20)\} END_TEXT ANS($critpts->cmp(showHints=>1, showLengthHints=>1)); ANS($signs->cmp(ordered=>1, entry_type=>"a sign"));

Hope that does it.

Davide