Computer Algebra Errors - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-21T05:04:26Z http://mathoverflow.net/feeds/question/11517 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/11517/computer-algebra-errors Computer Algebra Errors Kevin O'Bryant 2010-01-12T09:50:52Z 2013-05-11T03:51:46Z <p>In the course of doing mathematics, I make extensive use of computer-based calculations. There's one CAS that I use mostly, even though I occasionally come across out-and-out wrong answers.</p> <p>After googling around a bit, I am unable to find a list of such bugs. Having such a list would help us remain skeptical and help our students become skeptical. So here's the question: </p> <p>What are some mathematical bugs in computer algebra systems? </p> <p>Please include a specific version of the software that has the bug. Please note that I'm not asking for bad design decisions, and I'm not asking for a discussion of the relative merits of different CAS's.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/11518#11518 Answer by Kevin O'Bryant for Computer Algebra Errors Kevin O'Bryant 2010-01-12T09:55:37Z 2010-01-13T04:26:23Z <p>In Mathematica 7, the command</p> <p>Table[DirichletCharacter[4, 2, n], {n, 0, 8}]</p> <p>should return a list of values of the character with modulus 4 and index 2, evaluated at 0, 1, 2, ..., 8. Instead, it returns the decidedly non-multiplicative:</p> <p>{0,1,0,-1,0,-1,0,-1,0}</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/11529#11529 Answer by Bruce Arnold for Computer Algebra Errors Bruce Arnold 2010-01-12T12:11:16Z 2010-01-12T12:11:16Z <p>There are too many to be listed on the margins of MO.</p> <p>Look at the archives of the newsgroups comp.soft-sys.math.maple, comp.soft-sys.matlab, sci.math.symbolic, comp.soft-sys.math.mathematica. There you can find hundreds of bugs reported.</p> <p>There is a notorious CAS bug hunter who once maintained a bug list for Maple and shows more than 5000 disturbing observations. (Press the <a href="http://maple.bug-list.org/" rel="nofollow">Go!</a> button.) Or go to MapleSoft and search <a href="http://www.mapleprimes.com/search/node/bug" rel="nofollow">Maple Primes</a>.</p> <p>Please don't shoot the messenger. </p> http://mathoverflow.net/questions/11517/computer-algebra-errors/11532#11532 Answer by David Lehavi for Computer Algebra Errors David Lehavi 2010-01-12T13:09:58Z 2010-01-12T13:09:58Z <p>My advice is never to trust <strong>a single</strong> CAS. I only wrote one computer aided paper: I did the programming on Mathematica / Linux, and my collaborator did it on Magma / Solaris. We also made a point of not communicating while writing the programs.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/11578#11578 Answer by James for Computer Algebra Errors James 2010-01-12T20:16:06Z 2010-01-12T20:16:06Z <p>(I haven't sufficient points to post a comment to Leonid Kovalev's reply.)</p> <p>The problem in the numerical integration example is that numerical integration in Maple is done using Int, not int. The correct command should be</p> <p>evalf(Int(sin(x)^44,x=0..sqrt(44)));</p> <p>which should produce consistent results (and much more quickly).</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/11607#11607 Answer by Dan Piponi for Computer Algebra Errors Dan Piponi 2010-01-13T02:14:02Z 2013-02-13T15:03:08Z <p>I don't know any interesting bugs in symbolic algebra packages but I know a true, enlightening and entertaining story about something that looked like a bug but wasn't.$\def\sinc{\operatorname{sinc}}$</p> <p>Define $\sinc x = (\sin x)/x$.</p> <p>Someone found the following result in an algebra package: $\int_0^\infty dx \sinc x = \pi/2$</p> <p>They then found the following results:</p> <p>$\int_0^\infty dx \sinc x \; \sinc (x/3)= \pi/2$</p> <p>$\int_0^\infty dx \sinc x \; \sinc (x/3) \; \sinc (x/5)= \pi/2$</p> <p>and so on up to</p> <p>$\int_0^\infty dx \sinc x \; \sinc (x/3) \; \sinc (x/5) \; \cdots \; \sinc (x/13)= \pi/2$</p> <p>So of course when they got:</p> <p>$\int_0^\infty dx \sinc x \; \sinc (x/3) \sinc (x/5) \; \cdots \; \sinc (x/15)$$= \frac{467807924713440738696537864469}{935615849440640907310521750000}\pi</p> <p>they knew they had to report the bug. The poor vendor struggled for a long time trying to fix it but eventually came to the stunning realisation that this result is correct.</p> <p>These are now known as <a href="http://mathworld.wolfram.com/BorweinIntegrals.html" rel="nofollow">Borwein Integrals</a>.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/11630#11630 Answer by Victor Liu for Computer Algebra Errors Victor Liu 2010-01-13T06:16:35Z 2010-01-13T06:16:35Z <p>If you are performing numerical computations, then a more likely source of error is in roundoff or over/underflow. In these cases, I wouldn't say that the CAS is necessarily in the wrong, just that you need to know the properties of the underlying algorithm and either recast your input or reimplement it in a more numerically robust way. In such cases, decent introductions to numerical analysis should give you a feel for the types of issues you need to worry about.</p> <p>Of course, on the matter of symbolics, then there are no excuses for errors.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/13375#13375 Answer by Harald Schilly for Computer Algebra Errors Harald Schilly 2010-01-29T13:15:27Z 2010-02-17T11:39:03Z <p>Analytical Number Theoretic Functions in Mathematica are (sometimes) unreliable.</p> <ul> <li><a href="http://fredrik-j.blogspot.com/2010/01/zeta-evaluation-with-riemann-siegel.html" rel="nofollow">http://fredrik-j.blogspot.com/2010/01/zeta-evaluation-with-riemann-siegel.html</a></li> <li><a href="http://fredrik-j.blogspot.com/2009/08/torture-testing-special-functions.html" rel="nofollow">http://fredrik-j.blogspot.com/2009/08/torture-testing-special-functions.html</a></li> <li><a href="http://fredrik-j.blogspot.com/2009/07/another-mathematica-bug.html" rel="nofollow">http://fredrik-j.blogspot.com/2009/07/another-mathematica-bug.html</a></li> <li><a href="http://fredrik-j.blogspot.com/2009/06/meijer-g-more-hypergeometric-functions.html" rel="nofollow">http://fredrik-j.blogspot.com/2009/06/meijer-g-more-hypergeometric-functions.html</a></li> </ul> <p><a href="http://code.google.com/p/mpmath/" rel="nofollow">http://code.google.com/p/mpmath/</a> is part of Sage --- <a href="http://sagemath.org" rel="nofollow">http://sagemath.org</a> --- hence you can double check Mathematica values there.</p> <p>(sorry, i'm not allowed to post hyperlinks...)</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/15555#15555 Answer by Jacques Carette for Computer Algebra Errors Jacques Carette 2010-02-17T04:22:44Z 2010-02-17T16:30:04Z <p>Because the most popular systems are all commercial, they tend to guard their bug database rather closely -- making them public would <strong>seriously</strong> cut their sales. For example, for the open source project Sage (which is quite young), you can get a list of all the known bugs from <a href="http://trac.sagemath.org/sage_trac/report/1" rel="nofollow">this page</a>. 1582 known issues on Feb.16th 2010 (which includes feature requests, problems with documentation, etc).</p> <p>That is an order of magnitude less than the commercial systems. And it's not because it is better, it is because it is younger and smaller. It <b>might</b> be better, but until SAGE does a lot of analysis (about 40% of CAS bugs are there) and a fancy user interface (another 40%), it is too hard to compare.</p> <p>I once ran a <a href="http://www.cas.mcmaster.ca/~carette/CAS752/2007/index.html" rel="nofollow">graduate course</a> whose core topic was studying the fundamental disconnect between the algebraic nature of CAS and the analytic nature of the what it is mostly used for. There are issues of logic -- CASes work more or less in an intensional logic, while most of analysis is stated in a purely extensional fashion. There is no well-defined 'denotational semantics' for expressions-as-functions, which strongly contributes to the deeper bugs in CASes.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/15566#15566 Answer by Vladimir Dotsenko for Computer Algebra Errors Vladimir Dotsenko 2010-02-17T11:05:00Z 2010-02-17T11:05:00Z <p>A friend of mine told me about his experience with Maple (version 5 or 6, I think) when dealing with matrices over \mathbb{Q}(\sqrt{2},\sqrt{3}). When he computed the rank and the determinant for one particular 3\times3-matrix, he was told that the rank was 3, and the determinant was equal to zero. The answer to this paradox is, that by default, for determinants the symbolic computation methods were used for radicals, and for ranks, the floating point representations of matrix elements! </p> <p>This can be thought of as either a bug or his naiveness (for not checking out how to represent elements of number fields so that floating point representations never appear), but in any case is a serious argument for treating the computer algebra software with care...</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/16521#16521 Answer by Jan Jitse Venselaar for Computer Algebra Errors Jan Jitse Venselaar 2010-02-26T15:42:14Z 2010-02-26T15:42:14Z <p>A quite serious error in Mathematica 7 in my opinion is that it thinks \sqrt{x^2} =x, not |x|, leading for example to 2 solutions to the following differential equation:$$ y'(x) = 2 y(x) (x \sqrt{y(x)} - 1) \quad y(0) =1$$Mathematica happily gives the following solutions:$$ y(x) \rightarrow \frac{1}{(1-2 e^x +x)^2}, \quad y(x) \rightarrow \frac{1}{(1+x)^2} $$Of course, it is a theorem that there is a unique solution to a differential equation of this type, but that doesn't mean my students hand in the wrong answer in droves...</p> <p>Mathematica code: FullSimplify[DSolve[{y'[x] == 2 y[x] (x Sqrt[y[x]] - 1), y[0] == 1}, y[x], x]]</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/16918#16918 Answer by Michael Lugo for Computer Algebra Errors Michael Lugo 2010-03-02T21:06:24Z 2010-03-02T21:06:24Z <p>Here's one I came across just now, in Maple 12. The code</p> <pre><code>with(combinat): F := fibonacci: phi := (1+sqrt(5))/2: G := k -&gt; F(k+1)/phi^k; limit(G(n), n=infinity); </code></pre> <p>returns 0. But from the usual explicit formula for the Fibonacci numbers, which gives F(n) \sim \phi^n/\sqrt{5}, the output should be \phi/\sqrt{5}, or (5+\sqrt{5})/10. Replacing the built-in Fibonacci function with one that gives the explicit formula, and running the code</p> <pre><code>F := n -&gt; 1/sqrt(5)*(((1+sqrt(5))/2)^n-((1-sqrt(5))/2)^n); phi := (1+sqrt(5))/2: G := k -&gt; F(k+1)/phi^k; limit(G(n), n=infinity); </code></pre> <p>gives the correct answer. I've encountered things like this fairly frequently when using the built-in routine for Fibonacci numbers; presumably this routine doesn't "know" the asymptotics.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/16968#16968 Answer by Tim Campion for Computer Algebra Errors Tim Campion 2010-03-03T11:39:22Z 2010-03-03T11:39:22Z <p>Over the summer I came across an elementary bug in Magma when working with congruence subgroups of SL_2(Z). The isEquivalent function, which is supposed to tell whether two points are identified by a congruence subgroup, would miss a lot of identifications. For example:</p> <blockquote> <p>G := CongruenceSubgroup(2); % \Gamma(2)</p> <p>H := UpperHalfPlaneWithCusps();</p> <p>(G! [-11,4,8,-3]) in G; % Cast this matrix into \Gamma(2)</p> <blockquote> <p>true % It's really in \Gamma(2)!</p> </blockquote> <p>(G! [-11,4,8,-3]) * (H! 3/8); % Have the matrix act on the point 3/8</p> <blockquote> <p>oo % Magma correctly computes that it gets sent to infinity</p> </blockquote> <p>IsEquivalent(G, H! 3/8, H! Infinity()); % Are 3/8 and infinity equivalent under the action of \Gamma(2), and specifically, can you given me a matrix representing an element of \Gamma(2) sending the former to the latter?</p> <blockquote> <p>false [1 0] [0 1] % Doh!</p> </blockquote> </blockquote> <p>It's a pretty simple computation, and it was pretty clear what loop it was leaving out. We may have been running an old version of Magma, but anyway we reported the error to them, and they fixed it quickly, but I've never trusted computer algebra systems since!</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/16987#16987 Answer by Kurt for Computer Algebra Errors Kurt 2010-03-03T18:27:41Z 2010-03-03T18:27:41Z <p>Sometimes a CAS cannot get the right branch of inverse trig functions when calculating integrals symbolically. See for instance: <a href="https://pantherfile.uwm.edu/sorbello/www/classes/mathematica_badintegral.pdf" rel="nofollow">https://pantherfile.uwm.edu/sorbello/www/classes/mathematica_badintegral.pdf</a></p> <p>Apparently this is an unsolved problem in computer algebra.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/18563#18563 Answer by rgrig for Computer Algebra Errors rgrig 2010-03-18T09:31:19Z 2010-03-18T09:31:19Z <p>Mathematica 7.0.1 says that Sum[1/(k*Length[Divisors[k]]), {k, 1, n}] is the harmonic number H_n, which is clearly wrong. The correct answer is at <a href="http://mathoverflow.net/questions/18483/an-elementary-number-theoretic-infinite-series" rel="nofollow">http://mathoverflow.net/questions/18483/an-elementary-number-theoretic-infinite-series</a></p> http://mathoverflow.net/questions/11517/computer-algebra-errors/26173#26173 Answer by Nate Eldredge for Computer Algebra Errors Nate Eldredge 2010-05-27T17:58:11Z 2010-05-27T17:58:11Z <p>In 1999, when I first bought an HP49G, whose major selling point was a CAS, I thought I'd try summing the harmonic series \sum_{n=1}^\infty \frac{1}{n}. I was a bit surprised to see the result 1151.8697216.</p> <p>It turned out that it knew how to numerically compute the discrete antiderivative \Psi(m) := \sum_{n=1}^m \frac{1}{n} \approx \ln m + \gamma, and in the particular mode that it happened to be in, it would replace \infty with the largest floating-point number it could represent, which was just under 10^{500}. Indeed, \Psi(10^{500}) \approx 500\ln 10 + \gamma \approx 1151.8697216. </p> <p>The story has a happy ending: after changing some flags, it returned +\infty.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/27631#27631 Answer by Kevin O'Bryant for Computer Algebra Errors Kevin O'Bryant 2010-06-10T01:12:33Z 2010-06-10T01:12:33Z <p>Just found this in Mathematica 7.0 for Mac OS X x86 (64-bit) (November 11, 2008):</p> <pre><code>x=Exp[Pi Sqrt[163] ]; N[x-Round[x] ] N[x-Floor[x] ] N[x-Ceiling[x] ] N[x - Round[x], 2] N[x - Floor[x], 2] N[x - Ceiling[x], 2] </code></pre> <p>The functions Round, Floor, and Ceiling are the obvious functions, while "N" converts the infinite-precision expression to a floating point number (the last three lines are aimed at 2-digit precision, while the first three should be 16-digit). </p> <p>The first three calculations turn up as "-480." The last three give more correct values of -7.5*10^{-13}, 1.0, -7.5*10^{-13}.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/34986#34986 Answer by J. M. for Computer Algebra Errors J. M. 2010-08-09T09:44:20Z 2010-08-09T09:44:20Z <p>During some experimentation on <em>Mathematica</em>, attempting to symbolically evaluate an alternating series for the <a href="http://mathworld.wolfram.com/StieltjesConstants.html" rel="nofollow">Stieltjes constants</a> (formula 16 in the link) returns "Indeterminate", apparently due to the software attempting to evaluate the derivative of Hurwitz zeta where it shouldn't.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/35050#35050 Answer by Piero D'Ancona for Computer Algebra Errors Piero D'Ancona 2010-08-09T21:15:46Z 2010-08-10T08:10:35Z <p>This story heard from Enrico Bombieri. I do not know if it qualifies, since it is not a CAS bug, and in addition it is second-hand. However it might be quite effective in casting doubt in the mind of your students, if that's your purpose :)</p> <p>E.B. was doing some Riemann zeta zero crunching on his PC some years ago, the software he wrote seemed ok, and the next step was to run it on a mainframe to get some serious data. He was given the privilege to try it on the first Cray supercomputer. Most of the time results were nice, but every now and then he got really weird results. He and his coworkers spent some awful weeks trying to catch the bug. In the end, they cornered the problem: when the Cray divided 1 by 12 the result was a negative number...</p> <p>EDIT: I double checked, it was not a Cray supercomputer but a computer based on an early iteration of the Pentium chip (I guess an IBM one), and the <a href="http://en.wikipedia.org/wiki/Pentium_FDIV_bug" rel="nofollow">Pentium bug</a> was also encountered by others of course. Sorry for the inaccuracy.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/63130#63130 Answer by Roland Bacher for Computer Algebra Errors Roland Bacher 2011-04-27T08:43:02Z 2011-04-27T08:43:02Z <p>Not a bug but a difficulty for users:</p> <p>I do often not really understand how assignements work for CAS:</p> <p>Given a variable a with value, say, \pi, set b:=a and set now a to, say, e. What is the value of b?</p> <p>As I understand the answer depends sometimes on the context (working with symbolic variables, vectors, floating numbers etc.) and the exact behaviour is sometimes difficult to guess for me. </p> http://mathoverflow.net/questions/11517/computer-algebra-errors/63146#63146 Answer by Tobias Kildetoft for Computer Algebra Errors Tobias Kildetoft 2011-04-27T10:25:15Z 2011-04-27T10:25:15Z <p>Here is an example in Wolfram Alpha. A student had been given the assignment of finding the limit as n tends to infinity of \frac{1}{1+\frac{(-1)^n}{log(n)}}. He had correctly arrived at the answer 1. Now he used WA to check if he was correct. WA returned 0 (the command lim n-> inf 1/(1-(-1)^n/log(n)) ). On examining the steps, it turned out that WA had manipulated a bit and used L'Hopital on the expression \frac{log(n)}{(-1)^n+log(n)}.</p> <p>Note that if one instead asks for the limit of \frac{1}{1-\frac{(-1)^n}{log(n)}} WA correctly returns 1, using the same method one usually would.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/63147#63147 Answer by Anixx for Computer Algebra Errors Anixx 2011-04-27T10:31:23Z 2011-04-27T14:44:21Z <p>This error affects all versions of Mathematica from 6 to 8. The result of a function depends on what letter is chosen for argument when calling it. In the simplest case it can be illustrated as follows:</p> <p>in:</p> <p>A[\text{x_}]\text{:=}\sum _{k=0}^{x-1} x </p> <p>A[k]</p> <p>A[z]</p> <p>out:</p> <p>1/2 (-1 + k) k</p> <p>z^2</p> <p>The correct answer is evidently, the later. This behavior affects not only sums but also integrals, so one have to check so that the letter user for the argument not to coincide with the index variable used for definition. In the case of recursion this becomes very difficult. The following example shows that moving a factor not dependent on the index variable out of the sum sign changes the result:</p> <p>in:</p> <pre><code>A1[0,x_]:=1 A2[0,x_]:=1 A1[n_,x_]:=Sum[A1[-1 - j + n, x]*Sum[A1[j, k], {k, 0, -1 + x}], {j, 0, -1 + n}] A2[n_,x_]:=Sum[Sum[A2[j, k]*A2[-1 - j + n, x], {k, 0, -1 + x}], {j, 0, -1 + n}] A1[1,x]/.x-&gt;2 A1[2,x]/.x-&gt;2 A1[3,x]/.x-&gt;2 A2[1,x]/.x-&gt;2 A2[2,x]/.x-&gt;2 A2[3,x]/.x-&gt;2 A2[1,2] A2[2,2] A2[3,2] </code></pre> <p>out:</p> <pre><code>2 5 13 2 5 12 2 5 13 </code></pre> http://mathoverflow.net/questions/11517/computer-algebra-errors/63758#63758 Answer by Anixx for Computer Algebra Errors Anixx 2011-05-03T00:46:16Z 2011-05-03T02:27:58Z <p>Wolfram Mathematica 7 routinely confuses sums with integrals.</p> <p>Example 1:</p> <pre><code>DSolve[(-Log[Log[a]] f'[x] + f''[x])/(Log[a] f'[x]) == D[Sum[f[x], x], x], f[x], x] g[x_] := f[x] /. s g[x] </code></pre> <p>Checking the result by inserting it into the equation shows the result is incorrect:</p> <pre><code>(-Log[Log[a]] g'[x] + g''[x])/(Log[a] g'[x]) - D[Sum[g[x], x], x] </code></pre> <p>Example 2:</p> <pre><code>s=NDSolve[{0.9159460564995328*Derivative[1][f][x] == f[x]*Product[f[x], x], f[0] == 1}, f, {x, -1.9, 15}] Plot[Evaluate[f[x] /. s], {x, -0.4, 1.5}, AspectRatio -&gt; Automatic, AxesOrigin -&gt; {0, 0}] </code></pre> <p>In Mathematica 8.0 this has been fixed (i.e. it will report inability to solve the equations.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/65027#65027 Answer by Emanuele Paolini for Computer Algebra Errors Emanuele Paolini 2011-05-15T06:13:29Z 2011-05-15T06:13:29Z <p>Wolfram alpha is saying that the series of \sum_k\sin(2 k \arctan(k^2)) does not converge:</p> <p><a href="http://www.wolframalpha.com/input/?i=sum+sin%282+k+atan%28k%5E2%29%29" rel="nofollow">http://www.wolframalpha.com/input/?i=sum+sin%282+k+atan%28k%5E2%29%29</a></p> <p>instead it converges! Seems that mathematica is only dealing with limits of functions not with limit of sequences. </p> <p>Another simpler example is \sum_k \sin(2k \pi + 1/k^2):</p> <p><a href="http://www.wolframalpha.com/input/?i=sum+sin%282k+pi+%2B+1%2Fk%5E2%29" rel="nofollow">http://www.wolframalpha.com/input/?i=sum+sin%282k+pi+%2B+1%2Fk%5E2%29</a></p> <p>E.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/79056#79056 Answer by joro for Computer Algebra Errors joro 2011-10-25T07:20:55Z 2012-01-23T14:21:13Z <p>Here are some results where different CAS give conflicting results:</p> <ol> <li><p>\int_{y}^{\infty} \frac{e^{-x}}{x}{d x} for y \in \mathbb{R} and y>0. Wolfram Alpha <a href="http://www.wolframalpha.com/input/?i=int+exp%28-x%29%2Fx+dx+from+y+to+infinity" rel="nofollow">gives</a>$$\log{y}+\Gamma(0,y)$$and sage 4.7.1 gives$$ -{\rm Ei}\left(-y\right) $$</p></li> <li><p>For all integers n, <a href="http://coq.inria.fr/" rel="nofollow">Coq</a> proves$$n \mod 0 \equiv 0$$and <a href="http://www.cl.cam.ac.uk/research/hvg/isabelle/" rel="nofollow">Isabelle</a> proves$$n \mod 0 \equiv n$$(The proofs are just stated in theorems, I can give the exact theorems if needed). Interesting, both proofs doesn't seem to lead to inconsistency though AFAICT they depict the usual <em>mod</em>.</p></li> </ol> <p><em>[Added]</em> I am a fan of sage, but this bug annoyed me.</p> <p>sage 4.7.2 incorrectly reports the girth of a 7 vertex graph:</p> <pre><code>H=Graph([(0, 1), (0, 3), (0, 4), (0, 5), (1, 2), (1, 3), (1, 4), (1, 6), (2, 5), (3, 4), (5, 6)]) H.girth() 4 H.is_triangle_free() False </code></pre> <p>sage 4.3 and 4.6.2 return correct value.</p> <p><a href="http://www.sagenb.org/home/pub/4102/" rel="nofollow">sage session in the notebook and a plot of the graph</a></p> http://mathoverflow.net/questions/11517/computer-algebra-errors/79062#79062 Answer by Jonathan Ringstad for Computer Algebra Errors Jonathan Ringstad 2011-10-25T10:50:05Z 2011-10-25T10:50:05Z <p>This might get fixed in the future, but at the time of this writing, <em>Wolfram Alpha</em> gets apparently sometimes confused by logarithms of complex numbers:</p> <p><a href="http://www.wolframalpha.com/input/?i=log%25281%252B+1%252F2+i%2529+-+log%25281+-+1%252F2+i%2529" rel="nofollow">Wolfram Alpha --$\log(1+ \frac{1}{2}i) - \log(1 - \frac{1}{2} i)$</a></p> <p>For reference, should the problem get fixed: it claims that$2i = 2i\cot^{-1}(2) \approx 0.9272$.</p> <p>Curiously, the numerical approximation is correct, but the symbolic form seems to be wrong.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/90468#90468 Answer by David Speyer for Computer Algebra Errors David Speyer 2012-03-07T15:11:57Z 2012-03-07T20:40:24Z <p>We found some interesting bugs in Mathematica's integration software on <a href="http://mathoverflow.net/questions/15759/a-two-variable-fourier-series-and-a-strange-integral/15924#15924" rel="nofollow">this thread</a>.</p> <p>To wit, set</p> <pre><code>integral[m_,n_] = Integrate[Log[2+Cos[2Pi x]+Cos[2Pi y]] Cos[2Pi m x] Cos[2Pi n y], {x, 0, 1}, {y, 0, 1}]; </code></pre> <p>Then integral[1,1] should be$1/2-2/\pi$, but Mathematica 8.0.1 returns$1/2+2/\pi$. Values for other$m$and$n$are also wrong (see the question linked above), as can be quickly verified by replacing the "Integrate" command with "NIntegrate".</p> <p>Curiously, if one changes the limits of integration to {x,-1/2,1/2} and {y,-1/2,1/2}, then the correct answers appear.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/98435#98435 Answer by Aaron Meurer for Computer Algebra Errors Aaron Meurer 2012-05-30T23:10:17Z 2012-05-30T23:10:17Z <p>As was noted for Sage, for any open source CAS you can just look up the issue tracker. For example, here's the list if all the issues in SymPy tracker with the WrongResult label: <a href="http://code.google.com/p/sympy/issues/list?q=label:WrongResult" rel="nofollow">http://code.google.com/p/sympy/issues/list?q=label:WrongResult</a>. Most of them are pretty rare. You're much more likely to hit a bug that just gives an error when it shouldn't, or that gives an unexpected, but not technically wrong (mathematically), result. </p> <p>My advice is to double check your answer in some other way. The chances of the same bug manifesting itself in two different ways are almost zero. For example, you can check a result numerically, which will use a completely different algorithm from the symbolic version. Many CASs even have built in functions that do this for you. </p> http://mathoverflow.net/questions/11517/computer-algebra-errors/101942#101942 Answer by joro for Computer Algebra Errors joro 2012-07-11T11:33:53Z 2012-07-11T11:33:53Z <p>The PARI/GP Thue equations solver gives wrong results when they are conditional on GRH.</p> <p>Affected are at least versions 2.5.1 (latest) and 2.4.3.</p> <pre><code>? p=x^3 - 18*x^2 + 81*x + 1;a=3^3 %1 = 27 ? t=thue(thueinit(p,0),a);[#t,t] \\ conditional on GRH %2 = [3, [[0, 3], [3, 0], [19, 2]]] ? t=thue(thueinit(p,1),a);[#t,t] \\ uncoditional %3 = [4, [[0, 3], [3, 0], [27, 3], [19, 2]]] </code></pre> <p>Found on the pari-dev mailing list <a href="http://permalink.gmane.org/gmane.comp.mathematics.pari.devel/3629" rel="nofollow">http://permalink.gmane.org/gmane.comp.mathematics.pari.devel/3629</a>.</p> http://mathoverflow.net/questions/11517/computer-algebra-errors/130317#130317 Answer by Vladimir Reshetnikov for Computer Algebra Errors Vladimir Reshetnikov 2013-05-11T03:51:46Z 2013-05-11T03:51:46Z <p>$2^{4^{4^4}} &lt; 4^{4^{4^4}}\$ </p> <p>WA: <a href="https://www.wolframalpha.com/input/?i=2%5E4%5E4%5E4+%3C+4%5E4%5E4%5E4" rel="nofollow">False</a></p>