10
$\begingroup$

How necessary it is for a person planning to do research in pure mathematics to learn programming as an undergrad?

And if it is, then which languages would you recommend to her or him? And why? I am currently a first year undergraduate, and here we have C in the first semester, and no other programming language in the whole course. Is it enough for me learn only this language or do I need to learn other languages too? If so, then which ones?

I apologize in advance if my question does not belong here and please shift it to wherever it does. Or if the similar question has already been asked.

Thanks in advance to all.

$\endgroup$
6
  • 5
    $\begingroup$ If you like logic, Common Lisp. Also xkcd.com/1270 $\endgroup$
    – Asaf Karagila
    Commented Dec 31, 2013 at 14:47
  • 2
    $\begingroup$ @shrey : C is not that useful for pure math, when there are so many other languages that will do what you probably want to do so much more easily. It is possible for a pure research mathematician not to do any programming at all. However, if you are an undergraduate, you should consider learning some of the languages mentioned in the answers here so that you will be prepared to do research in an area of pure mathematics in which some programming or experimentation is useful. Someone mentioned Mathematica: you should also be aware of Maple. $\endgroup$ Commented Dec 31, 2013 at 16:20
  • 10
    $\begingroup$ I wouldn't get too caught up with the actual language actually. Learning to "think like a programmer" was my main takeaway when I took my first programming course. After that changing between different languages was just a matter of learning the different syntax and getting used to the quirks of each. $\endgroup$
    – Kelvin Soh
    Commented Dec 31, 2013 at 17:38
  • $\begingroup$ i would like to ask you about what happened in you thoughts since these advices you'd received? $\endgroup$
    – janmarqz
    Commented Nov 5, 2014 at 15:51
  • 1
    $\begingroup$ I ended up learning C as it was in my University syllabus, I wont still say that I know this fully well,but maybe pretty decent. And now I'm thinking of learning Python somewhere online. $\endgroup$
    – Shreya
    Commented Nov 9, 2014 at 10:59

5 Answers 5

10
$\begingroup$

MATLAB, Mathematica, R, Haskell, Ruby, Python and others. There are mathematicians who use different languages. It depends on what you need done.

$\endgroup$
3
  • $\begingroup$ @Amzoti Yes, sorry. Fixed it. $\endgroup$
    – user117293
    Commented Dec 31, 2013 at 14:58
  • $\begingroup$ Hey, Can you please tell me what I need to learn first at this stage (that is, after C )? I was thinking of python as I've heard that it is pretty easy for someone already knowas languages like C, C++. $\endgroup$
    – Shreya
    Commented Dec 31, 2013 at 14:59
  • 1
    $\begingroup$ @shrey Unfortunately, what you need to learn first/at all really does depend on what you want to do with it. If you're a first year undergraduate, you might not yet know what things in math you'd like to program (and I don't know which expensive things like Mathematica you have access to in school). $\endgroup$
    – Mark S.
    Commented Dec 31, 2013 at 16:38
7
$\begingroup$

Definitely anything higher than C which is the language of system programming - which you ain't gonna do (and I may add, it only still exists for historical reasons). Also avoid C++ which frankly has become too complex and bloated even for the technicians (why not C++).

Forcing C even on computer undergrads was bad in 1989 (we started first semester by attempting to prove algorithms' correctness on paper à la Dijkstra; not sure whether that was a wholly successful approach but it made you think). Forcing C on math undergrads in 2013 is appalling beyond words.

Look at Scheme, Lisp or Clojure, take a look at Coq. Check out Prolog and its derivatives (currently I'm reading up on Flora 2). A Haskell is fine too. Avoid languages that need to be compiled and have no run-time interpreter loops for experimentation.

Somewhat related and because it brings back good memories: "A Parable" by Edsger W.Dijkstra, sometime in 1973

$\endgroup$
3
  • 3
    $\begingroup$ I think you are being a little harsh although I get your point. Many times, a mathematician may not have a choice in what language (s)he is going to use because they will be working from established legacy code. I was a C programmer that went to work on software whose base code was created in 1963 in Fortran. Around that base the interface was constructed in C++, in which new algorithms were written as well. Whatever my preferences, I had to learn C++, which was a challenge but far from out of control. In fact, C++ evolved to the point where it was at least as fast as C in most computatio $\endgroup$
    – Ron Gordon
    Commented Dec 31, 2013 at 15:58
  • 5
    $\begingroup$ C is a nice little language (since 1999; C89 or pre-standard C was decidedly less nice). I agree about avoiding C++ if possible, but I can't see what's so bad about teaching C. It's not the best choice for teaching to math undergrads, since higher-level languages offer more convenient APIs, but it ain't so bad. $\endgroup$ Commented Dec 31, 2013 at 16:55
  • 1
    $\begingroup$ Python isn't a bad choice neither, if you want to be able to solve simple general-purpose programming tasks. And it has SciPy and Matplotlib libraries (basically the same functionality as Matlab). $\endgroup$
    – maxy
    Commented Dec 31, 2013 at 19:58
6
$\begingroup$

I am a PhD student in pure mathematics, doing research in symplectic geometry/representation theory, and I consider programming to be one of the most valuable skills I have. Part of the problem to starting math research is that you have no clue what problem to solve. I find it impossible to just sit at your desk and wonder, "What theorem should I prove today?" In order to gain a sense for what theorems I want to prove, I always investigate problems on the computer in whatever way I can.

I used to program in MATLAB, but have been recently converted to SAGE (www.sagemath.org). I cannot recommend SAGE highly enough. SAGE is an object oriented scripting language based on Python. It is high level and easy to quickly write code that works. It has built in packages that allow you to define modules, rings, groups, graphs, solve ODEs, integrate stuff - I could go on forever here. If you can think of a mathematical object, someone has probably already written a package in SAGE to handle it. There is also an excellent community over at http://ask.sagemath.org/questions/ where you can ask questions.

Oh, and everything is free and open source.

$\endgroup$
2
  • $\begingroup$ give me please your comments on GAP and on doing combinatorial group th. $\endgroup$
    – janmarqz
    Commented Jan 3, 2014 at 16:32
  • 1
    $\begingroup$ @janmarqz I have never used GAP to do any combinatorial group theory, so I don't think my opinion on the subject is of any value. $\endgroup$
    – jmracek
    Commented Jan 7, 2014 at 21:28
5
$\begingroup$

To develop the algorithmic instincts you want, you ought to learn a lot of abstract algebra, including subjects such as Cauchy's and Sylow's theorems on finite groups as well Schreier's and Kurosh's theorems on discrete infinite groups.. Plenty of evidence of this trend you can easily get by a simple look of some CAS like GAP or others.

$\endgroup$
4
  • 4
    $\begingroup$ I'd like to see some of your thoughts about this. How do Sylow's theorems develop one's algorithmic instincts? $\endgroup$
    – Ryan Reich
    Commented Dec 31, 2013 at 17:13
  • $\begingroup$ For example, you can use an inductive method prove the existence of Sylow's subgroups.. Here my clumsy attempt: juanmarqz.wordpress.com/cucei-maths/algebra/… $\endgroup$
    – janmarqz
    Commented Dec 31, 2013 at 17:29
  • 2
    $\begingroup$ Induction is not programming, though programming certainly uses it a lot. But none of the concerns specific to programming, or the benefits of taking an essentially algorithmic approach to one's work, are evident in inductive proofs a priori. $\endgroup$
    – Ryan Reich
    Commented Dec 31, 2013 at 20:12
  • $\begingroup$ I suppose that helps a bit to an undergrad, then $\endgroup$
    – janmarqz
    Commented Dec 31, 2013 at 20:45
0
$\begingroup$

Esoteric Programming Language should be suitable for mathematicians who love problem solving.

$\endgroup$

You must log in to answer this question.

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