# Is learning to use Mathematica useful for pure theoretical research in Mathematics and Computer Science?

I am looking for opinions from Mathematica users about Mathematica itself. After reading the faq, I thought that in some sense I "wish to solve a problem using Mathematica" ... although I understand that this question is probably too vague. I hope not to be distracting here.

I see that some researchers (in math and computer science) at my university use Mathematica to carry out intricate calculations. I wonder if mathematical software today is so good that it can do better than humans at symbolic manipulation. This would mean that it would be really worthwhile to acquire some background in using such software, especially in those fields of research where one often has to deal with huge formulas.

Also, two subquestions:

1. How does one cite the use of Mathematica in a research paper? One could in principle say "beginning from formula X, using Mathematica we get Y". Would that be accepted professionally?
2. Are these systems foolproof (particularly Mathematica)? I mean, is it known that there are no special instances of symbolic-manipulation problems for which the software could end up doing an error dealing with them?

P.S. I didn't find a proper tag for my question.

-
If the question is "is Mathematica better at manipulating formulas than humans" I'd say that in most cases it's so much better it's funny (eg it can work with polynomials that would take a human hours to write down, or can do integrals that would take hours to look up in Gradshteyn and Ryzhik and others that aren't there). So can Maple for that matter. But of course they have bugs so some answer might be wrong. And finally, viewing it as an algebra system only is too restrictive; think of it as a platform to do general computation (numerics, visualization etc). –  acl Dec 3 '12 at 17:36
I wrote this answer mathematica.stackexchange.com/questions/733/… to warn about reckless using Mathematica when it is not necessary. On the other hand it may be an indispensable tool. –  Artes Dec 3 '12 at 17:45
@NasserM.Abbasi I don't quite agree with that. All fundamental intuition we have about our world is essentially analytical. Pure numerics would drive us to chaos in no time. –  Leonid Shifrin Dec 3 '12 at 18:37
@NasserM.Abbasi It used to be that engineers were actually very good at math (meaning analytical computations), because they needed that. My grandfather was an engineer, and he was very good at it. Engineering is not my field, but I am still sure that best engineers have very strong analytical intuition coming not from numerics, even if their end results are all numerical. I actually think that the modern emphasis on pure numerics reflects ultra-specialization and is harmful for the industry at large (a layman's view :)). –  Leonid Shifrin Dec 3 '12 at 18:51
If I find myself using numerical, statistical, or even empirical solutions to real-world problems, I have a nagging feeling in the back of my mind that I just haven't thought hard enough about the problem. I have that nagging feeling a lot ;-) –  Jagra Dec 3 '12 at 21:29

“I wonder if mathematical software today is so good that it can do better than humans at symbolic manipulation. This would mean that it would be really worthwhile to acquire some background in using such software, especially in those fields of research where one often has to deal with huge formulas.”

I would say faster and more accurate symbolic manipulation is one of the main points of Mathematica so yes I’d agree with the above implication and that it would be worthwhile acquiring some background.

Symbolic manipulation appears in many contexts however, and your header question about its usefulness in “pure theoretical research in Mathematics and Computer Science” is almost a completely separate (and loaded) question in itself with its own philosophical and practical overtones well beyond the two subquestions posed. These subquestions do tangentially relate to these overtones though:

1. Citations: "beginning from formula X, using Mathematica we get Y" I think as general rule this would be OK provided details are provided (perhaps in appendices/code attachments) about how this was done and in particular how such results can be reproduced. Usually it is the conceptual insights that are of interest more so than the mechanical manipulation. The other way is to cite computational work is to create a related Demonstration and cite this using it’s own citation syntax (that appears below each Demonstration).

2. Correctness: For sufficiently large manipulations I think correctness actually becomes much more of an issue if Mathematica (or similar) is not used. The chance of error doing this manipulations by hand is much higher that from using Mathematica's inbuilt transformations. I’d even go further and say the chance of an error using these inbuilt transformations is actually much lower than the chance of an error appearing in published theoretical proofs (usually done entirely by hand). The caveat to this is of course good programming practice that builds upon these transformations and constant vigilance some of which Leonid mentioned but some rules of thumb I’ve found useful are:

• For lower-dimensions, implement solutions using at least 3 different (“conceptionally orthogonal”) methods. (The flexibility of Mathematica’s language means this is usually not too difficult and provides a good margin of error)

• For higher-order dimensions check for lower-order consistency (It is usually impractically to refine 3 different implementations so usually it is sufficient to settle on one for refinement and efficiency improvements in tackling higher-order dimensions)

• Use sanity checks often (graphs, implications of output in relation to obvious truths)

• Use validation suites routinely (either unit tests in Wolfram Workbench, or custom-made ones in the frontend- my preferred method)

• Cross-reference with other published algorithms/output

• Keep an open mind that errors are possible given these aren’t proofs but try to categorize possible error sources - e.g. One crude, overarching one for error sources:

I’d say 3) and 4) are pretty unlikely error sources; 2) is where most errors occur and hence its focus in the above measures (which can also help in confirming that 1) is a publishable result).

To the specific question in the header -take theoretical computer science (TCS)- one could ask is it even a result in “Theoretical Computer Science” if Mathematica is heavily involved? This comes down to definitions and philosophy. There is a school of thought that for example experimentation using high-performance computation in TCS is unlikely to yield too many insights. (I’m talking about traditional experimentation, not actual TCS proofs in mathematica which is again is an even more loaded question.)

Take one luminary - Scott Aaronson’s view about using high-performance computation in TCS research given in a presentation in which he states (slide 4):

The hope: Examining the minimal circuits would inspire new conjectures about asymptotic behavior, which we could then try to prove

Conventional wisdom: We wouldn’t learn anything this way - There are $~2^{2^{n}}$ circuits on $n$ variables — astronomical even for tiny $n$ - Small-$n$ behavior can be notoriously misleading about asymptotics

My view: The conventional wisdom is probably right. That’s why I’m talking in this session.

This stackexchange entry indicates some successes in in experimental complexity theory although it appears pretty limited and in limited domains.

I can offer a kind of counter-example in a Demonstration in which for a type of CNF circuit a conjecture about asymptotic (threshold) behaviour is surprisingly clear from considering only the first few dimensions $n=2,3,4$ (it had been checked statistically for larger values of $n$ and in related theoretical work)

(Note how “The hope:” part above implicitly reveals what is considered TCS or of value in TCS).

Then there are also the cultural issues worth considering.

How many (latex) papers in “TCS journals” even mention runnable code? (I’d suggest <1%)

Timelessness. It’s a pretty good bet that latex-generated PDF’s in TCS will be viewable in 10-20-50 years mainly because this format already houses so much scientific knowledge. Conversely it’s almost guaranteed that a sufficiently large Mathematica package (e.g. of the sort that might involve some systematic experimentation in TCS) will not be runnable in even 5 years. This of course is not a Mathematica issue per-se (it perhaps handles backward compatibility better than most) but one common to all experimentation since backward compatibility is an order of magnitude greater problem for runnable code compared with static documents. One of the potentially important things about the Demonstration site IMO is that maybe this backward compatibility will end up being managed for you.

This timelessness and cultural issues become relevant to the extent that your code becomes more and more complex and more and more part of your results - which in many ways will be inevitable in any systematic experimentation (if you take the philosophical position about the potential of symbolic manipulation in TCS) that might increasingly be needed to discover something new.

So my take it on using Mathematica systematically in TCS would be:

• For “mainly theoretical results” any motivation/checking/illustrations using Mathematica could be beneficial.

• Closer and deeper integration between mathematica experimentation and TCS is still a relatively unexplored and potentially fruitful area IMO (- as someone not working in the field) but … most experts in the area would probably disagree and at any rate …

• Technically the infrastructure for a larger-scale Latex/Mathematica - theoretical/experimental framework is not sufficiently developed (IMO) to currently go too far down this path.

• Demonstrations might be a step in the right direction and perhaps provide a good litmus test for the level of complexity in terms of symbolic manipulation used in TCS research. If it can be put into a Demonstration your work may have a better chance of gaining some sort of timelessness. Currently Demonstrations are a fair way behind what can be done in a notebook (e.g. integration of packages, input fields, external data sources etc) but IMO this situation may improve over time and particularly if WRI shares this view about the importance of imbuing this timelessness in computational research (perhaps adding package support, Google Play/App Store functionality etc).

-
And there are software defects. Here a surprisingly simple to reproduce reported recently in ArXiv arxiv.org/abs/1312.3270 involving big integers and matrix manipulation. –  caya Jan 1 '14 at 0:38

Regarding your general question: from my own experience, a large part of my research findings while still at academia would have been much harder or outright impossible to get without Mathematica, and that applies to both numerical and analytical work. I also know this for many other people. There are a number of areas where it allows you to get through some pretty sophisticated stuff without being an expert in some particular field, such as special functions, for instance.

1. No, in most cases saying "from X to Y you get using Mathematica" (or any other system) is not professional, at least in the fields I was working (theoretical and mathematical physics). You can say that you used Mathematica to obtain some results, but there should be a proof of them not relying on it. For some computations, one can attach Mathematica code and claim the results, but that happens mostly for some complementary or auxiliary results, not for main results you report in the paper.

2. No, these systems are not foolproof and probably will never be. They are tools, albeit very sophisticated, and as with any tool, however powerful, it all depends on the person who is using it. You should not rely on any single tool alone. What I personally was doing was to perform many checks, numerical and analytical, to make sure that the results I was getting were correct. Even if most of them were obtained with Mathematica, one can always devise cross-checks, check limiting cases, do computations in qualitatively different ways, perform some graphical checks, etc - what matters is that you understand the problem well, then you'll know what to do.

So, my take on it is that Mathematica is enormously helpful for both getting the understanding of the problem being solved and getting the actual results, but is not a replacement for a human, and not meant to be.

-
At some point I was dealing with formulas which had about 70000 terms each of which was a polynomail multiplied by several Bessel functions. I was able to use those formulas productively in Mathemaica, and there is no question that I would not be able to use or even obtain those without it. They were not, of course, the final result, but they were instrumental to get to it. –  Leonid Shifrin Dec 3 '12 at 18:22
Don't forget about graphical checks! –  murray Dec 5 '12 at 18:47
@murray Well, I sort of implicitly included them into the checks I was talking about. But may be it is worth mentioning explicitly. Edited. –  Leonid Shifrin Dec 5 '12 at 18:49

I agree with remarks of Leonid and acl - Mathematica is generally much better at performing large computations than are humans. I would add the caveat, though, that Mathematica can certainly miss special simplifications involving symmetry. As a result, there are plenty of situations that can be evaluated by hand but not by Mathematica. One area that is rife with this sort of thing is numerical differential equations. If you have an equation on a disk with symmetric initial conditions, then you might need to reduce the dimension using the symmetry by hand.

On the positive side, I published a paper in Complex Systems where the main result depended on the exact eigenvalues of a large, irregular matrix. This is exactly the kind of thing where Mathematica will excel compared to humans. Furthermore, as is often the case, once we know the eigenvalue and corresponding eigenvector - proving that fact is a simple computation. The solution is self-verifying.

-