[math-fun] Wolfram Alpha has disabled very large numbers
I wonder if this explains a recent frustration. While puzzling out the condition for arithmetic bursts in A129935, I lost faith in 9.0.1 and 8.0.4 numerics and signed up for an Alpha Pro trial. But I couldn't perform the Floor[...] != Ceiling[...] test on numbers as small as 10^10000. --rwg Sometime in the 2-3 weeks since I last mentioned the "large factorials" problem, Wolfram Alpha has "fixed" it... by disabling all input that gives an answer higher than about 10^10^9. This is true for inputs like "10^10^10^34", which involve no factorials at all. For example, "2^3250000000" works: http://www.wolframalpha.com/input/?i=2%5E3250000000 but "2^3300000000" gives an error: http://www.wolframalpha.com/input/?i=2%5E3300000000 Of course, large factorials give an error, beyond about 101000000! (the factorial of 101 million), which is about 10^10^8.88... On Thu, Feb 28, 2013 at 12:29 PM, Robert Munafo <mrob27@gmail.com> wrote: Thanks to each of you for the help. Meeussen Wouter had the great idea of actually figuring out what Wolfram's "wrong answer" was. In fact it's easy to divide one answer by the other and see the ratio is 20000, which makes it clear what happened. That means that the internals of Wolfram Alpha are actually computing those two results separately, rather than just computing one and then converting it into the other representation. Quite odd. I had other saved results from Wolfram Alpha for larger factorials, and I can see now that their wrong answers for 30000! and 100000! fit the same pattern: they're computing Gamma[N] when they should be computing Gamma[N+1]. There's another bug for factorials of even larger numbers. In the case of (10^10)! they give only the "power of 10 representation", and their answer is too big rather than being too small, and by a far greater amount. They give 10^10^10^1.0413926851582..., but the correct answer (by GP/PARI and my own implementation) is 10^10^10^1.0406306991294... In this case it's easy to see that Wolfram's answer is exactly 10^10^11. They are approximating n! as n^n, which "isn't even close" to the truth. Using two terms of the factorial form of the Stirling series [1] and expressing everything as a power of 10: (10^10)! ~ 10^(0.5*ln(2*pi)/ln(10) + 5 + 10^11 - 10^10/ln(10) + 1/(12*ln(10)*10^10)) (where "ln" is natural logarithm). You can see the dominant term 10^11 in there, but WolframAlpha is ignoring all the rest, which makes a big difference. They are doing the same thing for larger values, for example if you put in (10^20)!, their answer is equivalent to (10^20)^(10^20) = 10^(20*10^20) = 10^10^(21+log(2)/log(10)) = 10^10^10^1.328400603937241. I have reported this to Wolfram as a separate problem. This started when I was investigating the difference between my computed value of (10^100)! (the factorial of a googol) and the value on someone else's webpage. Googol factorial has been discussed at least as early as 1996; see [2]. - Robert [1] http://mathworld.wolfram.com/StirlingsSeries.html [2] http://mathforum.org/library/drmath/view/57903.html
On Tue, Mar 19, 2013 at 6:21 AM, Bill Gosper <billgosper@gmail.com> wrote:
I wonder if this explains a recent frustration. While puzzling out the condition for arithmetic bursts in A129935, I lost faith in 9.0.1 and 8.0.4 numerics and signed up for an Alpha Pro trial. But I couldn't perform the Floor[...] != Ceiling[...] test on numbers as small as 10^10000. --rwg
I believe the WolframAlpha team merely removed the "Power of 10 representation" software module from the repertoire of modules available to the Wolfram Alpha query engine. Here is WolframAlpha output from about a month ago: mrob.com/pub/math/images/20130227-WA-factorials.png Note the two answers which are different: the first answer is 20000! and appears in the same format given by Mathematica, while the second is Gamma[20000] = 19999! and appears in a "10^10^x" format. I did a lot of large numbers calculations and concluded that the "Power of 10 representation" was being computed by an entirely different software package. In particular, they were doing three different methods of approximating the factorial depending on the hugeness of the argument. In addition to Gamma[x-1], there was a range where you'd get x^x (which is too big) and a middle range where they apparently used a truncated non-Stirling series; all were noticeably wrong. After the recent removal of "Power of 10" results from Wolfram Alpha, what remains are the Mathematica-style results, which have always been true in my tests. The magnitude limit on these results, which I said was "about 10^10^9", happens to be "sort of" close to the magnitude limit for floating-point numbers in Mathematica, given by "MaxNumber" and typically either 2^(2^30-128) ~ 1.2334*10^323228458 or 2^(2^31-352) ~ 1.9202*10^646456887: http://mathematica.stackexchange.com/questions/501/what-determines-the-value... The MaxNumber limit is effectively a limit on the size of the "exponent" in the internal binary representation. The limit of the number of digits in the "mantissa" may be, and probably is, quite different. It would take so much more memory and computing time to compute all the digits of 20000!, just to be able to report that it is "1.819206320230345... x 10 ^ 77337", that I highly doubt they're doing that. Or in Mathematica jargon, I think they have WorkingPrecision set to something like 25, unless or until you explicitly request more digits. Somewhat related are SetPrecision and SetAccuracy, which do more specific things but I suppose they have these set to some standard default as well. Which is a long way of saying I think your 10^10000 issues are a matter of BigFloat mantissa precision, and thus unrelated. -- Robert Munafo -- mrob.com Follow me at: gplus.to/mrob - fb.com/mrob27 - twitter.com/mrob_27 - mrob27.wordpress.com - youtube.com/user/mrob143 - rilybot.blogspot.com
participants (2)
-
Bill Gosper -
Robert Munafo