Hacker News new | ask | show | jobs
by Yardlink 4253 days ago
It struck me as odd that they avoided floating point numbers because of impreciseness, then used some other type of number without evaluating how precise it was. They're certainly not using typical integers with values like 10^9000. I wouldn't be surprised if those numbers are internally divided by 10^n and stored in doubles anyway - bringing them back to the same problem they're trying to avoid.

"the determinant of bigMatrix is, approximately, 1.95124219131987ยท10^9762."

Approximately? How many significant digits in the exact answer? If Mathematica promises arbitrary precision, even to 10,000 digits, they have a case. If not, it shouldn't be any surprise.

As for getting different results on each run, I've seen this with iterative algorithms that use random starting values. For numerically unstable problems, that can lead to different results each time because it converges to rounding error.

That doesn't mean Mathematica is wrong any more than getting wrong results from doubles means its wrong. It just means it's poorly designed so the user doesn't know about this limitation.

3 comments

It's clear you aren't a mathematician. They work with "typical integers" like 10^9000 all the time, and certainly not as a trivial scaling of doubles.

There are 9763 significant digits in that calculation. They wrote it in shorter form because the actual digits were irrelevant. The numbers they got from Mathematica had the wrong sign and were off six orders of magnitude. There's no reason to list more digits to show that's the case.

Mathematica promises arbitrary precision. Here's the documentation. http://reference.wolfram.com/language/ref/Det.html . It says "Use exact arithmetic to compute the determinant", for the construction given in the paper. The also submitted a bug report, and got the statement "It does appear there is a serious mistake on the determinant operation you mentioned."

Yes, of course random algorithms can end up with different answers. The determinate definition is not random, the documentation for Det doesn't say it uses a random implementation, non-random methods to compute it are well known. Again, the vendor says it's wrong - why are you disagreeing with practicing mathematicians and the vendor? Why do you think you know enough about the topic to be able to judge what "odd" means, in the context of this sort of field?

"I wouldn't be surprised if those numbers are internally divided by 10^n and stored in doubles anyway"

I would certainly not expect this at all. These are not int64s here, but are instead "big integers" as bunches of languages have, see also GMP.

I don't know how Mathematica implements it internally but arbitrary precision arithmetic generally is a well documented subject: http://en.m.wikipedia.org/wiki/Arbitrary-precision_arithmeti...