16

Programming skills such as experience with Java, Python, C++ or work experience as a software developer can be indispensable for applied mathematicians. How useful is it to have such experiences as a pure Math graduate student where the focus tends to be on proofs and rigor rather than computation?

9
  • 9
    Define "useful" and "programming experience." Oct 6 at 23:44
  • Two applications come to my mind, and these should be two of possibly many: 1- one may use programming languages to numerically calculate results of integrations, expansions, formulas, etc; 2- there are packages like Mathematica which do analytical expansions and calculations. So, my answer is, Yes! Programming is a good skill to have, these days.
    – enthu
    Oct 7 at 10:45
  • 2
    I would look at this from a different perspective: programming requires a certain kind of logical, mathematical reasoning and thinking, so if you have programming experience then that should count as a point in your favour for a pure mathematics course, whether or not the course itself might involve any programming.
    – kaya3
    Oct 8 at 1:19
  • 2
    one thing i think everyone missed is, theorem provers (example of their usage for math) are (i hope) being used increasingly often - since it's nice to have a permanent, verifiable record that a certain theorem is true. (of course, i suspect this is far enough from convention that it won't be particularly common for a long while yet)
    – somebody
    Oct 8 at 9:51
  • 2
    I don't have the rep here to post an answer, but if I did it would be a form of my answer to the opposite question "Is mathematics necessary for learning to program?" which you can read at softwareengineering.stackexchange.com/a/137075/48582 ; a point I haven't seen yet in the answers here is that the skills you have developed from programming will help you considerably with learning Mathematics even with topics that have no visible link to programming. Oct 9 at 20:17

12 Answers 12

39

In many parts of pure mathematics you use software to calculate examples that a while ago you could do only with pencil and paper. That's particularly true in combinatorics (my field) and number theory.

There is a tradeoff. Sometimes you learn from the slow process that forces you to see what happens at each step - like looking at a program with a debugger. But you get a lot more data in a lot less time, so are less likely to be misled by the law of small numbers.

I have taught an undergraduate course whose purpose was to expose students to the possibilities of calculation: python, symbolic manipulation (mathematica and sage), spreadsheets, LaTeX for writing mathematics.

You may not need programming skills to be admitted to graduate school, but any on your cv would be a plus. You might well have to learn some when you start your researchl

3
  • 3
    Even limited programming skills make a huge difference when it comes to learning LaTeX, and LaTeX seems to be even more widely used in maths than physics
    – Chris H
    Oct 7 at 12:32
  • 1
    I once looked for certain paths in certain graphs with a computer and was then able to show their general existence after noticing patterns for small examples. However, even for those small examples, the graphs were not actually small (they were graphs of graph homomorphisms between small graphs), so I could not just have looked for the paths by hand. (A smarter person might of course have found a better proof, who knows.)
    – Carsten S
    Oct 7 at 15:16
  • Beyond Mathematica/Maple and the like, there're tools such as PARI/GP for number theory and GAP for discrete algebra (group theory).
    – Pablo H
    Oct 8 at 22:30
46

Not really an answer to what you asked, but: Look beyond grad school as well. Most math PhDs do not actually stay in academia but end up in industry in one way or another. Nearly every job mathematicians will eventually take on outside academic pure math research will benefit from having computer programming experience. So there may not be an advantage to knowing programming when you apply for grad school, but it will be useful to you in the future anyway.

3
  • 3
    "nearly every" ... True. But current math Ph.D. students (and their advisors) often do not want to admit it.
    – GEdgar
    Oct 9 at 12:11
  • 2
    @GEdgar Yes, but ignoring or denying the fact doesn't make it any less true :-) Oct 9 at 21:04
  • 1
    +1, it's super important to hedge. They don't like to admit it probably because the main point of a pure math education is to work in academia. It's kinda like admitting a lot of what you are doing is not really going to be of value to you in the long run. There are exceptions of course, but for many of the types of jobs people end up in there was probably a more useful field they could have enrolled in (eg if you end up as a programmer or developer more than likely cs would have been a more useful path [or stats/DS if they end up in prediction/modeling/database admins.])
    – eps
    Oct 9 at 23:21
7

Maybe, maybe not. Ignoring some of the more obvious expectations such as LaTeX, you might consider becoming familiar with Pari as well as Mathematica programming and Sage/Python. Apart from that the cognitive development that comes from learning both procedural and declarative programming can be fruitful in unexpected ways.

6

Computers are sometimes used to solve complex mathematical problems because it's impractical for humans to enumerate all the cases and combinations. Famously, the Four Color Theorem was proved using a computer.

There's a list of proofs that used computers in this Wikipedia article: Computer-assisted proof

And while the eventual proof of Fermat's Last Theorem was purely mathematical, computers were used by many researchers to confirm the conjecture for many cases.

0
5

Long-term usefulness aside - during your PhD, you might have to teach a class that is not pure math and may require you to know how to program...

4

Having a familiarity with programming languages is useful in pure math too. It is easy to observe some patterns by plotting a suitable graph.

For example in number theory, if we are studying a particular type of prime number and we want to see how they are distributed, the first step I would do is to plot the counting function to get an intuition which can not be done by hand. If this function is not studied before it is unlikely that you will find an existing inbuilt function in standard programming languages. In this situation, if you are familiar with programming then you have an advantage.

Also, we can do various calculations using a computer which would be laborious to do manually.

3

Yes. For example, in my case Matlab programming was quite helpful for plotting figure. The latex language Tikz/PGF the is almost very essential in plotting figures, diagrams in commutative algebra, algebraic geometry, number theory etc. The Language like PARI/GP and SAGE are very helpful in algebra and number theory.

0
3

As someone who is currently doing a PhD in mathematics, yes, it is definitely useful to have a prior understanding of programming. However, I don't think it is necessary - if you can keep up with the maths, the coding will follow.

A lot of people keep mentioning Latex. I wouldn't really call this programming per se, but you will definitely need to learn it. This is not very hard though.

You will almost definitely use some sort of programming language in a PhD for visualisation or computation (yes, computation is common even in pure maths these days). Exactly what languages/programming you will do is difficult to say with out more information about the project. 'Pure maths' is extremely general and can cover a vast range of fields.

3

Practical programming experience is very useful for any high-educated worker that spends most of their time behind a computer, and for a PhD-student in particular. Why?

Automation

As a PhD student, you will increasing likely be working with software systems in order to do basic tasks such as writing, literature search, interacting with students, having meetings, administration, grading homework. Some of this systems have a well designed UX (user experience) and allow you to tell the computer what to do at the speed of either your thoughts or your typing.

However, many of these systems can be rather painful. Often these are simple things, such as dragging the cursor all over the screen rather than pressing a key, or waiting 10 seconds on a page to load that could have been loaded while you were doing something useful. These are minor things, but when you have to do them ~200 times on a day, these annoyances add up. So, what to do?

Do it yourself

You could ask someone else to solve this issue, such as the developers of the software. However, this is a task more difficult for them than it is for you (assuming you have the practical programming experience): they need to change it (if they agree to change it at all!) and make it work for all users, you only need to make it work for yourselves.

This may sound a lot of work, but it's not bad at all, time-wise. It's a time investment that has paid of for me within a week, whenever I improved some frequent painful processes. And while the time gained may be peanuts, the main purpose is to remove annoyances, which allow more enjoyable and more focused work.

It's not particularly difficult, either, if you have some practical programming experience and know what tools are out there. A web-app drives you crazy? Write a user-script with Greasemonkey/Violentmonkey/Tampermonkey. Some simple DOM-manipulation often works, I personally use MDN as a reference. An application can use more keyboard shortcuts? AutoHotkey can help.

3

Well, in addition to other good points raised, in these days if a math/tech-oriented person is clueless about talking to computers in any serious way, they're just a babe-in-the-woods. Almost immediately incompetent in various sorts of not-strictly-math ways.

As many of us have noticed, "computers" are a big deal, as is the internet. Not all of that is relevant to "doing mathematics", but quite a bit is. I use Perl to rearrange text/TeX files, Python for basic computations, Sage for subtler computations and graphs... even if none of those computations or graphs enter in any public-facing paper I write.

Also, many notions from Computer Science, such as "scope of a variable-name", are quite valuable in understanding mathematical writing (and in writing more clearly). And in teaching more clearly, and understanding that most undergrads do not have the same sense of "scope of a variable" that mathematically trained people do.

One last thing: I myself would not want to be making choices based on weakness, rather than on interest and preferences. If one shuts oneself out from understanding how computers seriously work, ... well, maybe you'll be an "end-user". No reason to solicit that.

1

how useful are they when applying to pure a Math program?

Having to contend with (La)TeX to typeset your publications already means you'll be doing a bit of programming; and if you're even the least bit finicky, creative or perfectionistic, it will be more than a bit.

... you might think this answer is tongue-in-cheek, but many a grad student has TeX battle scars they could tell you about :-(

Want another example? Well, will you have a personal website? That often benefits from being able to program. Is there any chance you might want to demo some of the abstract concepts you work on for a wider audience? That would require programming. Will you be using abstract/symbolic math software packages? Another case programming comes into your life. Hell, if I could, I would reprogram my alma mater's math department building elevator, the logic of which I couldn't figure out.

So, programming is (nearly) everywhere, for pure mathematicians as well.

(Also, what @EthanBolker and @WolfgangBangerth said.)

0

Obviously having a skill is better than not having that skill. As far as direct applicability to a PhD in pure mathematics, Python and possibly C++ might be useful for certain kinds of computational work (such as generating examples or testing hypotheses) mentioned by other commenters here. But this is usually done using packages tailored more specifically for mathematics such as Magma or Sage.

If what you're really asking is whether experience as a Python or C++ programmer is going to boost your application, the answer is probably not, unless the advisor you're planning to work with wants someone who can do that (e.g., if they don't want to do coding themselves).

Not the answer you're looking for? Browse other questions tagged or ask your own question.