[LON-CAPA-users] Response Math unable to understand formula for incorrect responses
Gerd Kortemeyer
korte at lite.msu.edu
Sun Jan 29 21:31:25 EST 2012
Hi,
On Jan 29, 2012, at 3:12 AM, Seema Ali wrote:
> If the answer is correct, it will accept it as correct but if it is incorrect the Unable To Understand Formula error pops up and I would prefer if it said Incorrect instead. Is there something that I have set up incorrectly?
That's just Maxima's "equal" at work:
(%i5) is(equal(f(g(x)),x));
(%o5) unknown
* If the two sides are the same, the equality is always "true"
* If the two sides are not the same, Maxima goes "how would I know, since you didn't tell me what x is!" - and says "unknown".
Seems like the simple "=" is more like "identical":
<problem>
<script type="loncapa/perl">
$a = &random(2,6,1) * &random(-1,1,2);
$b = &random(7,9,1) * &random(-1,1,2);
$c = &random(7,9,1) * &random(-1,1,2);
$d = &random(2,6,1) * &random(-1,1,2);
$num1 = "$a * x + $b";
$den1 = "$c * x + $d";
#simplify the expression
$numerator=&cas('maxima',"num(trigsimp(($num1) / ($den1)))");
$denominator=&cas('maxima',"denom(trigsimp(($num1) / ($den1)))");
$function = "($numerator)/($denominator)";
</script>
<startouttext />Given the function
<m eval='on'>\[f(x) = \frac{$numerator}{$denominator}\ ,\]</m>
determine the equation of the inverse function.
<br />
Answer: <m>$f^{-1}(x)=$</m><endouttext />
<mathresponse answerdisplay="Good" cas="maxima" args="$function">
<answer>
f(x):=RESPONSE[1];
g(x):=LONCAPALIST[1];
is(f(g(x))=x);
</answer>
<textline readonly="no" />
</mathresponse>
</problem>
Does this work?
- Gerd.
> Below is the XML for the problem.
>
> The problem creates a simple rational expression and asks the student to find the inverse function of that expression.
>
> Thanks.
>
>
> <problem>
> <script type="loncapa/perl">$a = &random(2,6,1) * &random(-1,1,2);
> $b = &random(7,9,1) * &random(-1,1,2);
> $c = &random(7,9,1) * &random(-1,1,2);
> $d = &random(2,6,1) * &random(-1,1,2);
>
> $num1 = "$a * x + $b";
> $den1 = "$c * x + $d";
>
> #simplify the expression
> $numerator=&cas('maxima',"num(trigsimp(($num1) / ($den1)))");
> $denominator=&cas('maxima',"denom(trigsimp(($num1) / ($den1)))");
>
> $function = "($numerator)/($denominator)";
> @args = ($function);
>
> </script><startouttext />Given the function <m eval='on'>f(x) = \Large\frac{$numerator}{$denominator}</m>, determine the equation of the inverse function.
>
> <br />
> Answer: <m>$f^{-1}(x)=$</m><endouttext />
> <mathresponse answerdisplay="Good" cas="maxima" args="@args">
> <answer>f(x):=RESPONSE[1];
> g(x):=LONCAPALIST[1];
> is(equal(f(g(x)),x));</answer>
> <textline readonly="no" />
>
> </mathresponse>
>
>
>
>
> </problem>
>
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users at mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
More information about the LON-CAPA-users
mailing list