## Forum archive 2000-2006

### Michael Hamm - multiple correct answers, or answer with a constant

by Arnold Pizer -
Number of replies: 0
 multiple correct answers, or answer with a constant topic started 3/3/2004; 11:54:52 AMlast post 3/4/2004; 8:13:03 AM
 Michael Hamm - multiple correct answers, or answer with a constant  3/3/2004; 11:54:52 AM (reads: 1035, responses: 3) Hi, A couple of questions with which I hope someone can help me. First, consider the question "express this real-life scenario as a diff.eq." (without initial condition). Thw answer has a constant in it, which is not mentioned in the question, so students can choose any they like. Can I allow for that? How? And if not, then what shall I do? Second, consider the question "prove that this diff.eq. is separable by writing f(y) y' = g(x) ". I'll leave a blank for each function (f,g), but, of course, any answer pair which is a constant multiple of the 'correct' answer is also correct. Any ideas on how ot do this? <| Post or View Comments |>

 Michael Gage - Re: multiple correct answers, or answer with a constant  3/4/2004; 8:13:03 AM (reads: 1242, responses: 0) Take a look at the manpages for fun_cmp at http://webwork.math.rochester.edu/docs/docs/pglanguage/manpages/ From those examples: * fun_cmp('x^2 + y^2 + c', vars => ['x', 'y'], params =>['c'], limits => [[-4,4],[-2,6]], numPoints => 10 ) will match 'x^2 +y^2 + 25'.* fun_cmp( 'cos(x) + a*e^(-x) + b*e^(2x)', params =>['a', 'b']) will accept a linear family of solutions, e.g. solution set to a linear ODE* fun_cmp( 'x^2 +sin(c*x)' , params =>['c']) will NOT work. The expressions have to be linear in the parameters (but of course they can be non-linear in the variables such as x). There is more description at http://webwork.math.rochester.edu/docs/docs/pglanguage/pod/pganswermacros.html#fun_cmp() and the code in the differential equation macros file: PGdiffeqmacros.pl may give you some ideas as well. For example the subroutine ['x'], params=>['c']); ` but you may need to worry a bit about matching 0 with the parameter c being set to 0. Another good source of ideas on answer evaluator construction is the macrofile PGasu.pl which John Jones put together. If you want to do particularly subtle things in evaluating answers, the code files you need to look at are AnswerHash.pm, PGanswermacros.pl, PGdiffeqmacros.pl and PGasu.pl and the problems from such subjects as differential equations or linear algebra. --Mike <| Post or View Comments |>