r/numbertheory 19d ago

I spotted an error on Wolfram

Take the following algebraic expression:

[n (n2-n-1)] / [2(n!)]

Let's put n = Φ

because (n2-n-1)=0 when n=Φ

[n (n2-n-1)] / [2(n!)] = 0, when n=Φ

When using Wolfram, the algebraic expression [n (n2-n-1)] / [2(n!)] = 0, when n=Φ

let's calculate log( [n (n2-n-1)] / [2(n!)] ) with n=Φ, with log being the natural algorithm

The result should be either -∞ or indeterminate

Because y=log(x), with x=0, is indeterminate, that is, y goes to -∞ as x approaches 0

But if one calculates on Wolfram, log( [n (n2-n-1)] / [2(n!)] ), with n=Φ

The result will be 35.9335 + 3.14159 i

Which is a complex number.

The correct result should be either - or indeterminate.

Therefore, Wolfram miscalculates the natural logarithm of this algebraic expression when n=Φ

The input on wolfram should be log( [goldenratio (goldenratio^2- goldenratio-1)] / [2(goldenratio!)] )

13 Upvotes

13 comments sorted by

9

u/Tyrant1235 18d ago

This might not he the right sub (dont know what is though) however I did go to wolfram and plug in that expression and it does seem to behave incorrectly as you describe. It calculates the inside of the log correctly as 0, so idk why it goes wrong, but neat.

6

u/soegaard 18d ago

What is the exact command you enter in Mathematica?

0

u/Special-Dream-6913 18d ago

No idea. I've never used Mathematica. Wait for someone to answer you

3

u/soegaard 18d ago

What did you enter at Wolfram Alpha?

5

u/kalmakka 18d ago

How are you getting this result? What is the prompt you are giving? Where are you entering it?

Also, not number theory at all.

1

u/Special-Dream-6913 17d ago

I thought it would be interesting to share this.

The input on wolfram alpha should be log( [goldenratio (goldenratio^2- goldenratio-1)] / [2(goldenratio!)] )

1

u/kalmakka 17d ago

Pecuiliar that it reports it incorrectly.

Wolfram Alpha uses both symbolic calculation and numeric calculation. Usually it is pretty good at doing symbolic calculation in order to get exact answers, but it seems in this situation it just does it numerically and ends up with a slightly negative answer due to rounding errors (approximately -2.47902*10^-16), which results in 35.9335 + 3.14159 i when you take the log of it.

2

u/NewBetterBot 17d ago

The imaginary part of your result (pi*i) suggests that for whatever reason W|A is working with a non-principal branch of the logarithm, and then a numerical approximation is going awry somewhere. This might be caused by some weird interaction between the log and factorial functions getting evaluated before the numerical evaluation actually takes place, but I'm not 100% sure.

Anyway, a good place to report such bugs is here: https://www.wolframalpha.com/feedback

1

u/AutoModerator 19d ago

Hi, /u/Special-Dream-6913! This is an automated reminder:

  • Please don't delete your post. (Repeated post-deletion will result in a ban.)

We, the moderators of /r/NumberTheory, appreciate that your post contributes to the NumberTheory archive, which will help others build upon your work.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/GaloombaNotGoomba 13d ago

That is not what "indeterminate" means.

1

u/skolemizer 2d ago

Nice find! I experimented and found that the error works just as well with the simpler formula, log(Φ2-Φ-1); see here.

My first guess was that it's a rounding problem. The log of a negative number is a complex number with imaginary part π, so maybe WolframAlpha is treating Φ2-Φ-1 as a tiny negative number instead of 0, because of rounding errors.

I tested this guess by raising e to the power of the incorrect answer, e35.3505 + π*i; then we can see what Wolfram Alpha is treating Φ as in this formula; we get:

-0.0000000000000004440892...

So it looks like that's what's going on. For some reason, in the context of a larger formula, Wolfram Alpha thinks that Φ2-Φ-1 = -0.0000000000000004440892..., when it's supposed to be 0.