I think a quicker way than using string searching is to use has( '$RESPONSE',diff) to detect the presence of diff in the answer.
We are using 4.0 extensively this year and have not noticed this particular problem.
Mind you we used 3.01 on a small scale over the summer without having this problem also.
PS Agree with your first two sentences. It is amazing how little has been fixed in TA4.0
You can use things in packages no problem.
My memory is that you can't use the usual string delimiters in maple commands in the algorithm section because of their being used to delimit the whole Maple command. (I have not found how to escape them.)
Work arounds - you may be able to get away with omitting the quotes in the usual $S=maple(" BLAH "); provided TA does not choose to do something to the BLAH.
An alternative we have often used to get strings in is convert(`BLAH`,string); which produces "BLAH" in Maple without the need for quotes.
There is a lot wrong with TA, but I am not sure this is an example.
I don't see that any fixed algorithm for determining equivalence is likely to be satisfactory. After all, sometimes I feel there is really only one sensible general form for the answer and sometimes not.
In TA we have (essentially) two options:
1) Formula Q type - some pretty basic equivalence testing is done, which catches forms differing by multiplying out brackets and similar.
2) Maple-graded question type, where arbitrary Maple code can be thrown at the problem.
On the latter, we find that
is( simplify( ($RESPONSE)-($ans) ) = 0 );
pretty broadly applicable - sometimes one needs simplify(BLAH,symbolic).
Your abs problem is interesting. I have always had it in mind that simple numeric testing would be fine if some mod of the above doesn't work. Something like
`if`(0.001>add( eval(($RESPONSE)-($ans),x=s)^2, s in [seq(-3.14..3.14,0.1)]),1.0,0.0);
where the limits and step size could be adjusted for the problem in hand. Of course if the abs business is the only issue then acer's piecewise is neat.
Maybe I will regret this confident assertion with more experience, but it doesn't seem to me too hard to get round these problems.
I would *much* prefer TA;'s developers to fix some of the absurd bugs that still plague the system. See my previous post on this - and add to the list that TA STILL seems sometimes to deliver tests with missing formulae or graphics. Now that is something that it is really inexcusable not to have fixed in a piece of expensive software.
(3) Yes, I am aware that Maple-graded Q's do actually emerge correctly (otherwise LaTeX authoring would be completely useless). I remain amazed though at the charges for this software given that things like this have not been fixed.
(4) That is the hack I mentioned - we discovered it for ourselves - as far as I can see it is undocumented. It seems limited. When I have tried e.g. to return a list of of expressions converted to MathML it seemed to fail. Oh and by the way don't try and use "rank" instead of "switch" - that too seems buggy.
(6) Is MapleNet free to users with a Maple site license and a TA license?
We looked in to this on TA3. One can use Maple libraries, but bizzarely only as part of Maple grading code - not in the algorithm, etc. Posibly this has been improved in TA4, but i doubt it. This restriction makes them pretty useless, I think.
It does seem bizarre (pathetic even) that the examples in the documentation don't work.
Is anybody successfully using LaTeX to produce questions (beyond the simplest ones)?
Your question seems to have got a bit garbled, but if A, ..., A[k] are matrices then
`.`( seq( A[j], j=1..k ) );
multiplies them. Not sure if this is what you want or if it is the best solution.
Try using the assume command to tell Maple that all the constants in your expression are positive.
The problem with mailing seems in fact to be that the zipped Maple archive triggers antivirus software.
I am still curious why this happens.
I am not a statistician, but I suspect the answer is as follows - taking the more basic issue of variance for simplicity.
The variance is *defined* as Sum( x_j-mu)^2/N where mu is the mean of the distribution you are sampling from.
The formulas with N-1 arise because if you have only samples and do not know the mean mu of the underlying distribution you have to use the sample mean rather than the true underlying mean in the formula. The replacement of N with N-1 gives the best possible correction to allow for this.
Sorry - yes Joe, thanks for the correction. In both versions it should be f: x-> piecewise .....
I don't need a work-around - the "is" version works fine. I just wanted to understand what is going on.
The non-evaluation of :: seems a bit of a red herring to me. The same argument would apply to "less than", I think, but
f:=x->piecewise( frac(x) < 1/2, 1, 0):
works fine (although the graph surprised me at first).
It's worth being clear about JacquesC's branch cut example. The value of sqrt(1/(x-1)) and of sqrt(-1/(1-x)) depend only on which branch of the square root function you take. Once you have chosen that branch they are simply equal because the arguments are equal. Maple has a preferred branch and so gets consistent answers (and should do quite independent of automatic simplification), to judge from Michael's post.
The business about the two different forms of the argument leading to different behaviour seems wrong to me. It is certainly true that naive calculation of roots (by a human) gives sqrt(-1)=sqrt(exp(I*Pi)=exp(I*Pi/2)=I and sqrt(1/(-1))= ... = -I, but that just comes from not making a consistent choice of branch for your square root.
JacqueC's numerical example using evalf is interesting, but it simply reflects the fact that one is evaluating numerically a discontinuous (but completely well-defined) function and it is not surprising that one can get an error. It is of course interesting that the error may depend on whether the argument is written as 1/(x-1) or -1/(1-x)
type Matrix is "better" for most elementary manipulations. The following works as you want it to:
A := < < 1 | 2 > , < a | 3 > > ;
a := 5;
pantole - thanks, I'd done that to check my colleague's claim. He wants to persuade Maple to simplify it rather than just check numerically.
J.Tarr: thanks - I'd done that and with Maple 10 it returns unevaluated. Presumably you are using Maple 11?
Any suggestions for achieving this with Maple 10 or shall I tell my colleague to wait a couple of months until we upgrade!