There’s something I don’t understand about how Doenet is checking answers. When integrating 1/u du, the fully correct answer is ln|u|, but what if u is always positive? Like 1+x^2 or 1+e^(-.5x). In that case, I would like Doenet to accept the answer with or without absolute values.
The confusing thing is that it seems to me that sometimes it does and sometimes it doesn’t, depending on the u. (Matt already has a check on if the answer is off by a constant, by checking if the derivative of the correct answer minus the entered answer is 0. But the derivative of the absolute value has an identical absolute value term in both the numerator and denominator, and Doenet doesn’t seem to realize that the absolute value term never equals 0 and so can cancel).
Is there a way to get Doenet to recognize both forms of the answer, without having to specifically define both options and use an or statement? The way WeBWorK works is to check 5 random input values and if the expressions agree on all the values, then the two expressions are called equal. But it seems Doenet must be doing something different from that.
Chrissy
Since Doenet doesn’t have the ability to integrate, I assume you are just referring to tests where an expression like ln |u| is given for the answer.
If the answer checking is working correctly, then ln |u| should validate as being not equal to ln u. We don’t have an answer checking method that only checks positive values. I haven’t thought about equality checks restricted to certain domains.
The main algorithm for the default numerical equality of Doenet is to choose 10 or 20 random values from a region of the complex plane. If all those are close to being equal, then it marks the answers as equal. If not, it repeats a few times with choosing other regions in case the original choice hit a branch-cut nonlinearity). (There are some other checks it uses to avoid some false positives from this algorithm.)
I’m not sure how this algorithm would lead to the problems you are seeing. A ratio of absolute terms shouldn’t create any trouble.
Can you give some specific examples so I can see the bug in action?
Ah, I think that may explain it; you said you choose from the complex plane. I don’t think that’s typical for most classes to consider.
Here’s a (subset of a larger problem) that shows the issue I’d like to avoid: Doenet
Matt had defined F with parentheses, so the answer to version a was 1/8 ln(1+4 x^2). It marked my answer wrong when I typed in 1/8 ln|1+4x^2|. But 1+4x^2 is always positive for real x, which I assume is why the answer was defined with parentheses instead of absolute values in the first place. I modified the problem to accept both forms but maybe a better choice would have been to make the only correct answer the one with absolute values. On the other hand, I think it’s counterintuitive for most students (and professors!
) to be thinking of complex numbers as being options.
Chrissy
I see; I hadn’t thought of the case where removal of the absolute value does not change the function on the real line but does change it off the line.
The move to complex number wasn’t due to an expectation that anyone think of complex numbers. It was just an attempt to make a more robust equality checker, at least for analytic functions.
This does bring into question whether or not that is a good idea for non-analytic functions. I just hadn’t thought about the case where the absolute value does not change the function on the real line and people might expect the functions with or without the absolute value to compare as equal.
I’m not sure what to do about this. I added an issue about this unresolved question.