Hacker News new | ask | show | jobs
by kisonecat 2849 days ago
I'm one of the developers of Ximera.

Expression equality is handled by https://github.com/kisonecat/math-expressions using a few heuristics, which is necessary because Richardson's theorem says this problem is undecidable. The main trick is to regard the expressions as complex-valued functions, find a point where the value is (nearly) equal, and then check for numerical equality in a neighborhood. (Doing this over the complex plane addresses the problem that many common expressions like sqrt(small number-x^2) have a restricted domain over the reals).

We rely on unit tests from Chris Sangwin (who wrote the textbook _Computer Aided Assessment of Mathematics_) to ensure that we're adjudicating expression equality mostly correctly.

2 comments

Thanks for the response and info. I looked at the README and it seems like you all use Javascript for this. I was thinking maybe Maple or Mathematica was used. I'm impressed with the calculus notes/exercises I saw. It looks professionally done. The fonts/colors are nice.

I'm going to try to make some stuff myself. I would mostly do it for developmental math, college algebra, and trig. I haven't dug too deep into how to make my own stuff using Ximera but I'm hoping I won't have to write Javascript myself to handle checking expressions.

Maple and Mathematica are not open, and it's important that not only the resources be open-source, but also the underlying technology stack, because we're trying to not only teach students mathematics but the most engaged students need to "look under the hood" and learn how the technology works.

So we do support SageMath for more complicated answer validation. This depends on the public SageMath cell servers, which provides cloud-hosted SageMath and enables things like \sage{derivative(x*x,x)}. It's also more performant to rely on JavaScript.

For developmental math, answer validation is somewhat harder than for calculus, because often you want to distinguish between say (x+1)^2 and x^2 + 2x + 1.

We run workshops on how to use Ximera. The next one is at UFlorida in October. If you're interested, there is some travel support available. Contact us at ximera@math.osu.edu

Interesting! When you assess the equality on a neighborhood, what's the algorithm that decides on the number and location of samples?

For polynomial functions, it's clear how many samples to use; what about others? Do you settle on a magic constant and call it a day?

The magic number is currently 100 samples; the perturbation size is "adaptive" in that the perturbation size is changed when the expressions appear to equal but they're also close to zero.

The main goal is to make sure that we pass the tests listed in https://github.com/kisonecat/math-expressions/blob/master/sp...