MathOverflow is a question and answer site for professional mathematicians. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is a survey question, which seeks to produce a list of answers from the audience of mathematicians.

Motivation: I'm doing research in mathematics education. I'm particularly interested in teaching mathematicians programming and utilizing programming to teach the metacognitive skills necessary for mathematics.

Question: Was programming/computer science brought up in your undergraduate/graduate mathematics education? Did you see any consistent problems that you and your peers experienced with computer science/programming constructs?

share|cite|improve this question

closed as off-topic by Ricardo Andrade, Lucia, Yemon Choi, Stefan Kohl, quid Nov 9 '14 at 19:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about research level mathematics within the scope defined in the help center." – Ricardo Andrade, Lucia, Stefan Kohl, Community
If this question can be reworded to fit the rules in the help center, please edit the question.

This is very much a blog-style question; in particular it definitely doesn't have an answer. – Qiaochu Yuan Nov 2 '09 at 4:16
hrm... well, I would posit that neither does "Most interesting mathematics mistake?" but that's posted here. Maybe it's off-topic, not sure. idk if a rewording would make it more reasonable – Michael Hoffman Nov 2 '09 at 4:19
OK, I think I un-blog-ified it – Michael Hoffman Nov 2 '09 at 4:27
Our policy for now is that the only "discussion" questions allowed are ones that explicitly seek to produce a sorted list of answers. Anything that requires conversation should go elsewhere. I think this question is a poor fit for mathoverflow, and would certainly be more suitable on the blogosphere, but I think it's sufficiently interesting I'm not going to close. :-) – Scott Morrison Nov 2 '09 at 17:06
-1: I have often been supportive of questions that others have considered off-topic in the past, but I think that MO is the wrong place for survey questions. – Pete L. Clark Dec 27 '09 at 5:47

11 Answers 11

My personal thoughts (and experience):

"Was programming/computer science brought up in your undergraduate/graduate mathematics education?" - yes, but I took math+CS+physics for my undergrad. This isn't very rare though; at least in my time (and place), most math majors took some CS (If nothing else, there's a big overlap in the required courses). My feeling is that most mathematicians of the younger generation have at least beginner-level programming skills, but my view could be biased. Of course being able to program could be useful for doing certain types of math research; for other types, it's not really useful at all.

"Did you see any consistent problems..." - I don't think so, and in fact I believe that for people who have solid math background, learning the fundamental skills necessary for programming is relatively easy.

I don't know what "metacognitive" means, but I feel that it's reasonable to expect that people who understand programming languages may have an easier time grasping certain kinds of mathematical definitions and points of view. For example, it may be useful to think of mathematical objects in an "Object-Oriented" way, thinking about what forms part of their data structure (and what doesn't) and what "methods" they expose.

It may also be useful to think about what it means to "calculate" something abstract (like the cohomology ring of a manifold) even when there is no real possibility of implementing the calculation; just reasoning about what it means to say that data X can be calculated for object Y can be useful. So here, too, a certain kind of CS-like training can be useful (and is increasingly common anyway).

share|cite|improve this answer
Interesting... very different from my experience. Very pleased to get a different view on things. Thanks! – Michael Hoffman Nov 2 '09 at 7:48

Most of the responses so far pointed out that people who are good at mathematics tend to benefit from computer programming, and don't have much problem learning it. I majored in math and computer science, and for me the two reinforced each other.

I would like to mention some of my experiences using basic computer programming to teach mathematics to non-mathematicians. In particular, I use Excel.

Liberal Arts Math: I use Excel in my Liberal Arts Math class, so the programming is very basic and is practically restricted to functions. At that level, though, it really gets the point of functions and iterations.

Calculus II: for the definite integral, having the students do all the necessary computations through a spreadsheet helps to solidify the concept.

Differential Equations: Euler's method lends itself nicely to a spreadsheet. In that course, we used graphing software to generate solutions to DE, especially solutions to systems of DE, but we didn't program them.

On a different note, I remember a few years ago there was an AMS minicourse during the Joint Meetings, on using Flash and Java modules in Discrete Mathematics, and some of the ideas were really neat. But I think that's a bit off topic as to the question at hand, because the students weren't the ones doing the actual programming.

share|cite|improve this answer

Programming is about great algorithms but also great code. Code is great when it is readable, well-structured, self-documenting, extensible, reusable, modular, and especially maintainable. In my experience, it takes most computer science students the entire duration of their undergraduate studies to truly understand how to write such code, and even then they will often initially struggle to write very maintainable and easy-to-read code when they get their first professional job out of college. (This depends also very much on the school you are looking at. This observation would probably be false at, say, MIT.) Put simply, knowing lots of algorithms is necessary but not nearly sufficient for being a great programmer.

However, learning to write such code is essentially an exercise in learning how to communicate your solution to a problem to others who may have very different backgrounds. It's hard for me to imagine how this skill would not be useful in mathematics where one will spend much of one's time teaching and writing expository and research articles.

share|cite|improve this answer

I double majored in math and computer science but otherwise, there would have been no requirement for me to take any programming classes. As my programming skills and mathematical problem-solving skills developed, they both informed one another. I often turned to my programming experience for making combinatorial arguments and the mathematician in me made sure I'd thought through all possible ways a program could progress.

As far as consistent problems, I'd have to second Michael Hoffman's answer. In my experience, mathematicians have little trouble solving a programming problem but actually getting it into code can be an obstacle. Knowing what the answer is doesn't help you if you can't write it down within the confines of whatever language you're using. Planning ahead and pseudocode are both really helpful for getting around this. Plus, this is probably familiar to mathematicians who don't code - I find myself writing down some mathematics for the first time, then realising that somehow I'm not saying what I really want to say or that I'm not even saying it correctly.

share|cite|improve this answer
Thanks! Do you think that the disconnect with proceduralization might have to do with emphasis on "continuous" mathematics rather than "discrete" mathematics? By that I mean, that in mathematics, at least as I have been taught it, we tend to focus on mathematics that cannot be computed directly because it's "continuous" in nature, and the transfer to a discretization for solution in programming is not readily apparent. Anyway, cheers! – Michael Hoffman Nov 2 '09 at 13:59
I'm not sure that it really has to do with continuous vs. discrete - though, on that note, could you give an example of what you mean by "mathematics that cannot be computed directly"? Something I didn't mention earlier was that I think programming is a neat way to help people learn problem-solving in a concrete way and to repeatedly reinforce common techniques of problem-solving, which can certainly help with learning math. – Myron Minn-Thu-Aye Nov 2 '09 at 23:51
So, by this I mean something of the sort as the analytic computation of an integral, which is not done in real settings in numerical analysis b/c numerical methods can, of course, not be calculated up to infinitesimal limits – Michael Hoffman Nov 3 '09 at 6:26

It's interesting that you mention that topic, since I currently have a programmer/developer job.

One particular aspect I didn't think much about before but see clearly now: programmer's job consists of many tasks:

  • creating the design
  • getting input from users
  • writing code
  • fixing code
  • writing documentation
  • testing code
  • passing the audit

The first part is incredibly helped by having math abilities. For the other parts, even being a math genius won't help much: it's more about being punctual, accurate, able to work a lot, concentrate and deal with people. On the other hand, those are necessary for the mathematics as job and profession (teaching, writing papers) as well.

share|cite|improve this answer

Programming and Computer Science was not required in my undergraduate training (I have not started graduate training so I cannot say with regards to that). From what I've seen in numerical analysis classes, there seems to be some disconnect between understanding the problem and being able to proceduralize the algorithm. For some reason proceduralization is particularly hard.

share|cite|improve this answer

I'm like a few previous responses in having enough CS training to handle basic programming skills. My difficulties have primarily been in mundane/trivial things like compiling, or relearning syntax after years of not using a language.

In general, I think sometimes it's easy to overgeneralize and say that all younger students are good at computers. This may be partially true, but there are many younger students that are not at all comfortable with computers, and for which programming does not make sense. Although there is a lot of overlap, programming skill doesn't completely correlate with mathematical skill.

Probably the difficulty is mostly in the different point-of-view. CS solutions/programs are built using techniques that differ from math solutions. One must be extremely precise, one must be able to extract a template out of a solution process, one must be able to adapt that template to the programming language. I think that is where the main difficulty (and much of the educational benefit) lies.

share|cite|improve this answer

University of Waterloo Computer Science is part of the Faculty of Mathematics so any CS student has to take some Mathematics courses. As I did finish the requirements for a Combinatorics & Optimization major as well as a Pure Math minor, I did enjoy taking a lot of Math courses. I enjoyed seeing both Numerical Analysis and Symbolic Computation as both represented ways to convert Mathematical concepts into programmatic constructs. I enjoyed the contrast of the two as each seems to take a different approach at a fundamental level, to my mind.

Some elements like the Simplex Method for Linear Programming and Linear Regression in Statistics did come up in both Math and Computer Science courses with some differences on the focus as each course had its own view on what was important in the material.

share|cite|improve this answer

I very much liked math in high school but liked computers as well. In my second year I started to suspect that I am a practitioner. Three years after that I was sure that I am, but not without visiting a theoretical conference. At this point I would say I am a decent generalist programmer - I am pretty good at writing readable code, using the simplest solution possible and not reinventing the wheel. It is hard for me to imagine what it is like to reason about things in 13th dimension but not being able to translate English into some code that compiles and passes some simple tests (given reasonable scale of work, of course).

I love what I do, but I also must have written a for loop over 10,000 times by now, so some aspects of it get boring. I miss the time when I had to think really hard about something new. I liked learning about finite automata back in college because regular expressions libraries utilize them. I would love to take a class on Markov Chains because I can see how they can be applied to very real problems. I also want to take Optimization, Linear programming, Statistics ... maybe one day after work.

As you can see my math background is pretty weak, although my math grades were decent and I really liked the subject. There are some things which I am not good at at all - such as thinking in abstract terms. With much effort I can probably force myself to think along those lines, but it is not natural and I have to draw it out, and try to relate it to the actual 3D world that I know.

I am definitely not a mathematician, but I can call myself an engineer I suppose. I often wonder if things would have been different, if my parents forced many logical puzzles on me before I was four year old. I have seen math professors do that to their kids ... I guess it is both nature and nurture.

share|cite|improve this answer

My undergrad was B.Sc. Math, and my program required four courses when I entered: two intro courses using Java, a programming lab which just was practise in a particular language (either C++, Prolog, or something else I can't remember), and a data structures course.

The latter two were dropped from the requirements since the entire system was redesigned, but I took two extra courses anyway: advanced C++ and formal languages.

I can't comment on any struggles, because I was bunched up with engineers and CS majors. Great courses though, and if anything they helped because experimental mathematics is just really fun.

share|cite|improve this answer

I taught my little sister calculus last summer by essentially giving her a mini numerical analysis course using Python. This enabled us to focus on the concepts of calculus, understanding definitions, and seeing how the major theorems all worked (on a discrete approximation level), all without much algebra (which is the major stumbling block for most students).

We coded a function grapher, a numerical differentiator, a numerical integrator , an diff Eq. solver. We also coded approximations to the exponential, log, and trig functions by viewing these functions as solutions to diff Eqs, and solved a lot of "real world" problems using these tools.

We bounded the error of our numerical integrator so that we could specify a desired degree of accuracy to our integral. This is obviously useful in any applied context (we need to know how accurate our approximations are), and it means she really recognized the importance of the formal definition of a limit.

Only after we had all the major concepts of calculus down did we start to play the symbolic manipulation games. This part of the course was less interesting, but we saw that it sped up our computations a lot (instead of having to do thousands of operations to approximate an integral, I can do maybe 10 to get the exact answer).

The experience was very interesting for me because I realized how much of calculus can be seen through the lens of Euler's method. You can really explain pretty much everything.

I am very interested in making a sequence of guided programming exercises which would teach calculus this way on the web. I started making some using Khan Academies open source material, but have not gotten very far. It will probably have to wait until the summer.

P.S. The net effect? I would say that she is weaker at churning out integrals than most students (I don't think we ever even talked about trig substitution, etc). However if you ask her what a derivative is she can tell you. If you ask her to explain how the fundamental theorem of calculus works, she can explain it to you. If you give her a novel physical problem she is very well equipped to think about breaking it into easy small subpieces, and using a limiting process to get a good approximation to a solution. In other words, I think that she has a much deeper understanding of calculus than a "standard" student, and because of this she will be able to apply calculus when it naturally arises in her life. She also learned how to program, which has independent value. We also had a lot of fun.

share|cite|improve this answer
Oops. Didn't see this was a thread necromancy. – Steven Gubkin Sep 26 '12 at 16:43
How old is she educationally? (tenth grade US?, asking purely for academic purposes, not trying to fix her up.) How much time did it take (rough estimate of coding-testing-tutorial-homework breakdown would be nice to know.) Gerhard "Really, My Interest Is Educational" Paseman, 2012.09.26 – Gerhard Paseman Sep 26 '12 at 21:57
She is going into what would be her senior year, but she graduated a year early. I should note that she doesn't really like math/wasn't doing well in her precalculus class. We did about a week of playing with coding using JES (jython environment for students) doing some image manipulation and making sure she knew about for loops, boolean logic, ect. She got really good at coding through the math projects. We spent about 12 weeks total, working a few hours a day. She learned differential and integral calculus. – Steven Gubkin Sep 27 '12 at 0:23

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