I'm a freshman student in mathematics, and I'm considering whether or not to take a programming course. How important is programming for mathematicians? Do working mathematicians use programs to aid their research?

  • 28
    $\begingroup$ Some mathematicians use programming every day, others never use it in their research. Mathematicians employed outside academia almost always use it. If you are a freshman, you don't yet know what you will be doing later. So take a programming course! [I could continue OT: take a foreign language, take a literature course...] $\endgroup$
    – GEdgar
    Apr 15, 2012 at 12:40
  • 9
    $\begingroup$ In any event: the skills (e.g. debugging, being able to shift levels of abstraction) and discipline that can be acquired though programming helps a great deal in constructing proofs, among other things... and it never hurts to learn programming, I always say. $\endgroup$ Apr 15, 2012 at 15:06
  • 4
    $\begingroup$ You may want to browse some of my answers, especially ones with the combinatorics tag; I often use short programs to find initial terms of sequences, explore hypotheses, search for counterexamples, generate tables and graphs, ...; I used to sometimes include code as part of an answer, but after asking this question on meta, I started using gist for that. $\endgroup$
    – joriki
    Apr 15, 2012 at 15:39
  • 3
    $\begingroup$ I think I could probably copy here my answer to the converse question on Programming, but I'm lazy so I'll just link to it: programmers.stackexchange.com/q/136987/48582 $\endgroup$ Apr 15, 2012 at 18:08
  • 1
    $\begingroup$ For what it's worth, I happen to disagree with points from all 8 (at the moment) answers written below. But I agree completely with GEdgar's comment above. $\endgroup$
    – davidlowryduda
    Apr 15, 2012 at 19:57

8 Answers 8


The answer is definitely yes, and there are many reasons. The three most important are:

  • The bigger your "toolset" is, the more you can do.
  • You do not know what you will be doing in the future.
  • Computers are right now are omnipresent, and efficient computer use = you know how to program and automate things.

To be more specific, I will just name a few concrete cases:

  1. It is much easier to verify multiple cases using computer, e.g. the only known proof of the four color theorem is computer-assisted.
  2. Computer can solve (symbolically) many tedious things fast, things that would take you weeks or even months to calculate by hand, e.g. integration, many types of ODEs or PDEs, minimization problems, linear programming and extrema finding, even formula simplification.
  3. Every mathematical software (Maple, Matlab, Mathematica, but also Sage, Octave, and so on) are based on a programming language that you use to tell the program what you want to do.
  4. Many mathematical problems are too hard to solve symbolically, but often you can find numerical solutions with arbitrary precision.
  5. A number of math-related topics (or other domains that extensively use math nowadays, like computational biology, meteorology, financial analysis, quantum physics, ...) requires computers to work with.
  6. Using computer you can visualize your results to gain intuition, or to present it to a wider audience, etc. Trust me, it really does help, knowledge of a programming language will help you here a lot, e.g. with generating and transforming data. Even on math.SE people use $\LaTeX$, which is a computer programming language, imagine all those posts typesetted using trivial monospace font!
  7. Automation! This is what computers are really good at, so if you need to preform some well defined tasks on large sets of data, just make computer do your work. However, usually in a research there are no tools that would do exactly what you want, just some building blocks of some sort, so you need to know how to use them and build even more awesome things.
  8. Also, you have no idea where life will throw you, it is good to know that skilled programmers (and big part of this skill is keen mind and approach to problem solving) earn a lot of money ;-)
  9. Programming can be rewarding on its own, especially if you use nice tools. For a mathematician, I would recommend you a functional programming language, e.g. Haskell.
  10. Finally, theoretical computer science is a part of mathematics (theoretical computer science $\neq$ informatics, I am talking about ideas and algorithms, not HTML tags and FreeBSD admin knowledge). As the field is very large, people tend to differentiate, but there are still areas where there is no boundary between.
  • 3
    $\begingroup$ some of these points refer to using computers generally in your work, rather than programming skills specifically. I would not say that solving an ODE ought to require programming skills - typing it into Wolfram Alpha will work just as well. $\endgroup$
    – Ronald
    Apr 15, 2012 at 14:27
  • 11
    $\begingroup$ Also - e.g. LaTeX is a mark-up language, not a programming language. The syntax to format a page nicely in LaTeX is something that most researchers will need to learn, but this not at all related to a programming course. $\endgroup$
    – Ronald
    Apr 15, 2012 at 14:42
  • 3
    $\begingroup$ One can't always trust what the computer spits out, though. If you can't program, how do you know if the mathematics itself or how you presented it to the computer is what's giving you problems? $\endgroup$ Apr 15, 2012 at 15:07
  • 12
    $\begingroup$ @Ronald It is a markup language, but it is also a programming language. In case you are not aware of this, $\LaTeX$ is perfectly fine with loops and conditional statements and there are people who use this facilities in work. In fact $\TeX$ is Turing-complete, and if you are still not convinced that it is a programming language, please read this: Rapid Prototyping in $\TeX$. Besides, knowledge about programming languages, does help me a lot, not only with using $\TeX$ as a markup language, but also with typing ODEs into Mathematica. $\endgroup$
    – dtldarek
    Apr 15, 2012 at 17:56
  • 1
    $\begingroup$ @Ronald \latex is a programming language. As dtldarek said \tex is turing-complete. And actually it is not just conceptual, you sometime have to write complexe pieces of code in order to properly display, auto-generated data. $\endgroup$
    – Ugo
    Apr 15, 2012 at 20:51

Being able to write a program to test conjectures or just try to see what is happening in a problem is certainly an asset.

  • 3
    $\begingroup$ +1 This! Programming helps you do experimental math. To prove something you first need to find something to prove. You need to experiment, build some intuition,... Sure, occasionally it is possible to compute enough many example cases by hand, but there are limits to that. $\endgroup$ Apr 15, 2012 at 16:09

I am not a mathematician. But I love some mathematical topics. I believe that automation can't be ignored as a tool in today's mathematics of all levels. You need to be at least familiar with the concepts of programming. You can grow your skills over time to cover your core interests. For example, you should know about variables, loops, etc. but not worry about web design using HTML and CSS. If you learn a bit each year, in few years you will gain a very good skill that will allow you to prove and check your work and possibly enjoy mathematics more. Also, in today's world, learning programming is not difficult. If you can understand Mathematics, general programming principles will be a piece of cake!


I use programming all the time in my daily research and I think many other also do so. On the one hand, the development of algorithms is indeed a part of applied mathematics itself. Moreover, it can be really helpful to check identities or even to form conjectures by programming.

Read more about experimental mathematics here or have a look at the book collection here to get an impression how programs help in different field of mathematical research.


I have a Ph.D. in mathematics and I did two postdocs and worked as an assistant professor for five years in which I spent much of my time on research. I currently work as a software developer.

It depends completely on the type of math you are interested in. If you are interested in pure mathematics as opposed to applied mathematics the answer is generally that a programming language is worth much less than another semester of math under your belt. Proofs are the only gold standard in that area and computers rarely furnish them. Read the abstracts of papers for the top math (pure) journals in just about any given month and you can verify this for yourself.

The applied mathematicians I knew seemed to make more use of a computer, but it still depended wildly on the specific area of applied math they were interested in. Some areas of applied math seem to have researchers who really primarily do proofs and hence probably made little use of software themselves. Others were very interested in computer simulations of specific examples.

On the other hand it is by no means uncommon for people who major in mathematics to eventually find themselves doing professional software development. Given the number of math doctorates compared to the number of CS students, I am surprised often I have run into another math doctorate lurking among the software engineers. It's not bad to have programming as a fail-safe in case you don't end up in a job that is actually doing mathematics for a living. Though honestly a single course is unlikely to land you a software job.

  • 1
    $\begingroup$ Even those intending to obtain a Ph.D. in the purest of pure mathematics will almost always be MUCH more marketable with some programming and computer science background. I suppose an example of an exception would be someone at the near Fields Medal level who is actively pursued for faculty positions by top 10 universities. (continued) $\endgroup$ Apr 16, 2012 at 15:22
  • $\begingroup$ (continued) Nearly all smaller U.S. colleges see this as very positive for job candidates to have, because such a person has broader teaching capabilities and is typically a better resource for their undergraduate majors. I personally know someone whose Ph.D. work was in iterated forcing (set theory) and is now a very valued departmental member because of his computer science background (largely self-taught, by the way). $\endgroup$ Apr 16, 2012 at 15:23

I think programming is useful in some branches of mathematics to have some concrete examples, which may lead to a conjecture or even a proof.

One example is using programming to find out some integer sequences related to a problem, then checking it out using The On-Line Encyclopedia of Integer Sequences™ (OEIS™) (www.oeis.org)

From there, one can get a clue of what is the underlying formula behind the integer sequences and from there work out a proof.

If I am not mistaken, the Birch and Swinnerton-Dyer conjecture arose from using programming to generate some data. Also, the (in)famous Four-Coloring Problem in graph theory was proved using some computer checking.

So yes, I believe programming is useful for mathematicians. Some purists do not believe in using computers (Andrew Wiles was quoted to say "I never use a computer."), but I believe this is changing soon in this new generation.


Definitely programmers need math knowledge much more than mathematicians programming :-)


I'm currently a senior in college, majoring in mathematics, so I'll give you my (hopefully useful) perspective on the problem, and I'll try to not repeat anything people have already said.

I went into college pure-math. That's all I studied, I was going to do grad school after I graduated, and then I was going to go into academia. That was the plan. Up until the fall of my junior year, I mostly stuck to this plan (apart from some silly distributional requirements). But then I got burned out. Did a little too much math in the fall of my junior year, and decided it really wasn't for me. So I took a chance and took some computer science courses.

I can't speak to whether or not it will be useful for math research, although my intuition tells me that it most likely wouldn't hurt. I found the theoretical computer science courses (graphs and networks, design and analysis of algorithms) to be very interesting and fun, and it wasn't until after I took some CS that I really understood how poorly I understood computers.

I can't say that taking computer science has deepened my ability to do mathematics, but it's certainly exposed me to a new branch of math (theoretical CS), given me many useful tools for doing math (especially stat), and even if you don't think it will be the most useful professional skill (which, for most jobs, it should be), it's still a great life skill to have. I won't guarantee that it will be useful for your math research, but I will say that I can't imagine how the knowledge won't benefit you in a substantial way in your future. Best of luck!


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .