<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [LON-CAPA-users] Extracting the numerical value fromasolve()Maxima command</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Part of my problem was to round to the nearest hundredth and sometimes incorrect answers were marked correct because of the tolerance. I placed an example below of this happening.  I couldn't find a solution to this online and came up with the following, which seems to be working.<BR>
<BR>
$answer = &roundto($answer,2);<BR>
Format:3F<BR>
Tolerance: 0.001<BR>
<BR>
<BR>
<BR>
Example of question accepting incorrect responses"<BR>
Format: 2F<BR>
Tolerance 0.01<BR>
<BR>
Sample question:<BR>
Solve for $x$ to the nearest hundredth where $8^{3 x} = 7^{-4 x - 10}$.<BR>
<BR>
The answer ends up like this:<BR>
-1.39; [-1.39775850485268; -1.37775850485268]<BR>
<BR>
I calculated the answer to be $x = \frac{-10 \log 7}{3 \log 8 + 4 \log 7} = -1.38775850485268... \approx -1.39$.<BR>
<BR>
<BR>
Thanks.<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: lon-capa-users-bounces@mail.lon-capa.org on behalf of Seema Ali<BR>
Sent: Wed 2/8/2012 8:22 PM<BR>
To: Discussion list for LON-CAPA users<BR>
Subject: Re: [LON-CAPA-users] Extracting the numerical value fromasolve()Maxima command<BR>
<BR>
Thanks.  I'm learning something new every day about Lon Capa.<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: lon-capa-users-bounces@mail.lon-capa.org on behalf of Gerd Kortemeyer<BR>
Sent: Wed 2/8/2012 6:41 PM<BR>
To: Discussion list for LON-CAPA users<BR>
Subject: Re: [LON-CAPA-users] Extracting the numerical value from asolve()Maxima command<BR>
<BR>
Hi,<BR>
<BR>
On Feb 8, 2012, at 9:29 PM, Seema Ali wrote:<BR>
<BR>
><BR>
> I can't tell what is causing the error.  It works with other negative solutions.<BR>
><BR>
><BR>
> ERROR: Computer's answer is incorrect ("-1.24"). It is likely that the tolerance range [-1.24200376392202, -1.24000376392203] needs to be adjusted.<BR>
> This error occurred while processing response 1_7 in part 0<BR>
<BR>
The problem indeed is the interplay between your answer format and your tolerance:<BR>
<BR>
<numericalresponse answer="$answer" format="2F"><BR>
<responseparam name="tol" type="tolerance" description="Numerical Tolerance" default="0.001" /><BR>
<BR>
* You have "2F" as the answer format, which means two digits right of the decimal, as in -1.24.<BR>
* Your tolerance is set to "0.001", which is three digits right of the decimal.<BR>
<BR>
MAXIMA apparently calculated -1.24100376392202 as the answer. Your tolerance of 0.001 gives you  [-1.24200376392202, -1.24000376392203] as the accepted interval. The "2F"-rounded solution is -1.24, which is outside your own tolerance.<BR>
<BR>
I would suggest to either use "3F" for the format or "0.01" for the tolerance, so that the computer's calculated answer is actually graded as correct.<BR>
<BR>
- Gerd.<BR>
<BR>
_______________________________________________<BR>
LON-CAPA-users mailing list<BR>
LON-CAPA-users@mail.lon-capa.org<BR>
<A HREF="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users">http://mail.lon-capa.org/mailman/listinfo/lon-capa-users</A><BR>
<BR>
<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>