## WeBWorK Problems by Alberto Candel -
Number of replies: 1
Good Morning,

I am having trouble with these problem (code copies below)
It seems to accept any answer. Any suggestions as to what may be wrong? Thanks.

## DESCRIPTION
## Calculus
## ENDDESCRIPTION

## KEYWORDS('differentiation', 'economics', 'marginal')
## Tagged by YL

## DBsubject('Calculus')
## DBchapter('Applications of Differentiation')
## DBsection('Applications to Business and Economics')
## Date('')
## Author('')
## Institution('ASU')
## TitleText1('Calculus')
## EditionText1('5e')
## AuthorText1('Stewart')
## Section1('')
## Problem1('')

DOCUMENT();

"PG.pl",
"PGbasicmacros.pl",
"PGchoicemacros.pl",
"PGauxiliaryFunctions.pl"
);

TEXT(beginproblem());
$showpartialcorrectanswers = 1;$a = random(30, 90, 10);
$b = random(10000, 90000, 2000);$c = random(200,300,5);
$d = random(30, 110, 10); TEXT(EV2(<<EOT)); The price-demand and cost functions for the production of microwaves are given as $p = c - \frac{x}{a}$ and $C(x) = b + d x,$ where $$x$$ is the number of microwaves that can be sold at a price of $$p$$ dollars per unit and $$C(x)$$ is the total cost (in dollars) of producing $$x$$ units.$BR $BR (A) Find the revenue function in terms of $$x$$.$BR
$$R(x)$$ = \{ans_rule(40) \}
$BR$BR
EOT
$ans = "($c - x/$a)x"; ANS(fun_cmp($ans, var=>['x']));

TEXT(EV2(<<EOT));
(B) Find the marginal revenue function in terms of $$x$$.
$BR $$R'(x)$$ = \{ans_rule(40) \}$BR $BR EOT$ans = "$c - (2*(x))/$a";
ANS(fun_cmp($ans, vars=>"x")); TEXT(EV2(<<EOT)); (C) Find the marginal revenue when $$x = 1500$$ units are produced.$BR
The marginal revenue is \{ans_rule(40) \} dollars per microwave.
$BR EOT$ans = $c - (2*1500)/$a;
ANS(num_cmp($ans)); ENDDOCUMENT(); In reply to Alberto Candel ### Re: rochester_problib_setAlgebra20QuadraticFun_lh3-1_4-6edit2.pg by Arnold Pizer - Hi Alberto, Thanks for reporting the bug. It is now fixed in the svn. I had difficulty locating the pg problem which is NationalProblemLibrary/ASU-topics/setDerivativeBasicFunctions/3-7-13.pg. You seem to have a different name/location for the problem. For future reference when reporting bugs in problems it is best to first go to "Edit this problem" and then click on "report problem bugs". This gives more information about the bug, e.g. the seed and precise name of the problem. The bug in the problem is a typical error. In my example the correct answer is 230x - (x**2)/70. By default WeBWorK uses test values in the range (0,1) and basically checks if the student's answer and the correct answer agree up to .1 percent. For test points in this range, 230x - (x**2)/70 and 230x - (2x)/70 are closer than that. To fix this you can adjust the tolerance or the range the test valuse take. I did the later changing$ans = "$c*x - (x**2)/$a";
ANS(fun_cmp($ans)); to$ans = "$c*x - (x**2)/$a";
ANS(fun_cmp(\$ans, limits=>[-100,100]));

Arnie