Should Competent Programmers be "Mathematically Inclined"?

I think you missed the point, he said mathematical inclination not being good at math. Being good at math usually means you can compute a lot of things. Being mathematical inclined usually means you enjoy working with abstractions. A lot of mathematical inclined people are not good at math. The point is a propgrammer’s job is to work with abstractions and make them work reliably. Heck, I even heard of a programmer, who took the real real world idea of asteroids colliding, and created an original abstraction of their movement behavoir. Sure sounds like a mathematical inclination to me.

I think the best argument is this quote by Gian-Carlo Rota:
Most people, even some scientists, think that mathematics applies because you learn Theorem Three and Theorem Three somehow explains the laws of nature. This does not happen even in science fiction novels; it is pure fantasy. The results of mathematics are seldom directly applied; it is the definitions that are really useful. Once you learn the concept of a differential equation, you see differential equations all over, no matter what you do. This you cannot see unless you take a course in abstract differential equations. What applies is the cultural background you get from a course in differential equation, not the specific theorems. If you want to learn French, you have to live the life of France, not just memorize thousands of words. If you want to apply differential equations, you have to live the life of differential equations. When you live this life, you can go back to molecular biology with a new set of eyes that will see things you could not otherwise see.

mathematics arithmetic

Hey Jeff, you’re looking at all the wrong math. Math is much too large of a subject to just claim it doesn’t help. Calculus doesn’t help.

Discrete math http://en.wikipedia.org/wiki/Discrete_mathematics (logic, sets, number theory…) help programmers immensely. Good programmers will be good at this kind of math.

Don’t confuse math with arithmetic (or calculus, or anything applied or specific). Math is all about abstract reasoning. As Bertrand Russell said:

Mathematics may be defined as the subject in which we never know what we are talking about, but we know whether what are saying is true.

In math, objects are defined based upon their properties, as opposed to specific, concrete things. It’s the abstract reasoning that’s useful to a programmer. Any time you’re dealing with interfaces or abstract classes (or whatever your language calls those concepts) you’re applying abstract reasoning. I think that any programmer who can’t reason well abstractly may be able to pound out cookie cutter code, but probably won’t be able to understand things like design patterns, or when its ok to break those rules.

I perceive programming to be very similar to writing a proof. I have a math, rather than a CS background, which may explain my bias. Most CS papers that I’ve seen look like math to me. Design patterns, class hierarchies, etc, all look like math to me.

when doing a bachelors degree in statistics, i found it easier to remember complex formulea, theories and curves by implementing them in C. Jeff, for some obscure reason, i found it twice as hard to write statistical applications in basic!!
an example of a program i wrote in my first year was simple ANOVA or analysis of variance. of course, once the program is written, the fun wears off and the method is sort of yours for life.
i agree that programming helps one learn math and maths sharpens ones saw very nicely. i never did get round to writing a program to calculate allocation of resources optimally within given constraints and every now and then, i wish i had one :slight_smile:

Im often ashamed that ive got nil math skills, but i find math so boring i just cant bother to learn it. I was taking a statistics and probability course that would directly help me at a project but i got out of it. I cant do the exercises, get some time to stop and learn it. Its anoying to manually solve this stuff. Maybe im spoiled because when programming i can just write the formulas and the computer solves it for me.
But to really learn math, i need to sit down and do loads of exercises til its stuck in my head. Those huge frequency tables, enoumous equations… all those aparatus, just plain anoying to do it mannualy. But, unfortunatly, its what it takes to learn it. Theres no other way. Its the same as in programming: to be a better programmer you need to program a lot.

But im still willing to learn math. Any recommendations(books, methods, etc)?

LTMSQ, this is an outstanding april fools, logic and reason are also just nice to haves when it comes to programming.

Im often ashamed that ive got nil math skills, but i find math so boring i just cant bother to learn it. I was taking a statistics and probability course that would directly help me at a project but i got out of it. I cant do the exercises, get some time to stop and learn it. Its anoying to manually solve this stuff. Maybe im spoiled because when programming i can just write the formulas and the computer solves it for me.
But to really learn math, i need to sit down and do loads of exercises til its stuck in my head. Those huge frequency tables, enoumous equations… all those aparatus, just plain anoying to do it mannualy. But, unfortunatly, its what it takes to learn it. Theres no other way. Its the same as in programming: to be a better programmer you need to program a lot.

But im still willing to learn math. Any recommendations(books, methods, etc)?

this really depends on what you are writing. some fields, like graphics, audio, games… in fact anything multimedia or attempting to model the real world is a complete minefield of advanced maths. :slight_smile:

Raytracers and 3D physics simulations as a hobby in college required matrix algebra before I ever took the course.

but I was most impressed by a fellow student who wrote a program that could solve/reduce equations symbolically… basically shuffling text patterns in a tree structure…

but it could handle most of our homework for math ‘proofs’!

I haven’t read most of the comments above me, but I imagine most of them endorse math knowledge for algorithms and other small-scale situations. In addition to these, math can help you derive good abstractions! Admittedly, the kinds of abstractions that are easiest to derive with math are not always the kinds of abstractions that most procedural or object-oriented languages are well-suited to, but in out multicore future when functional programming possibly begins to gain real mainstream traction, these abstractions will be trivial to translate into code. Algebraic structures, category theory, type theory, discrete maths, graph theory, and more. All can be invaluable.

I was a math major, one of my last classes was on multidimensional partial differential equations. Oh, the good old days.

Skip forward a few decades. I’m working as a NOAA contractor, but on the display side instead of the modeling side. Another group has a supercomputer that runs weather models – multidimensional partial differential equations.

Right after I leave that job I’m taking a graduate level course on parallel programming… and we have access to that supercomputer! The instructor chose to focus on a particular type of parallizable problem – multidimensional partial differential equations. He never really teaches the class the math – it’s a multiyear sequence from calculus for most people – but he goes over the algorithms without deep explanation. It takes me a month to realize it, but I suddenly make the connection to the long forgotten class and everything snaps into place… and I’m the only person in the class (other than the professor) who has any idea what’s going on. :slight_smile:

This is an unusual case, and of course scientific programming (even if just on the display side) is probably going to attract a disproportionate number of people with strong math backgrounds, but it’s definitely a case where knowing math made the difference between blindly stabbing at code and understanding the problem well enough to make meaningful contributions.

(Earlier, while at NOAA? I did do some overt scientific programming where I needed my math/physics skills in addition to my CS skills, but obviously that’s domain knowledge that will naturally select people with those math skills.)

I feel my relatively basic math skills are my biggest weakness as a developer. I personally am humbled by the mathematician I work with on a daily basis.

Knowing math is a must for competing in the Google Code Jam. http://code.google.com/codejam/ I did horribly (only survived one round) but it was insanely fun. If someone likes math and programming I highly recommend trying it out this year (will probably be July again).

One thing that translates pretty directly is a sort of code algebra. The most simple speedup you can think of, pre-computing something outside of a loop, is very similar to distributativity. Code that commutes is threadable…

I have used higher math knowledge in a following way. We had an applications where users could set the time they wanted the event to happen with 15 minutes granularity with a 5 minute interval. With a large number of users this meant that we had huge peaks at these times and the application went slow as hell. We used normal distribution to distribute the start times around the specified time and got really great results.
Other maths i have used can generally be considered common sense i think.
But of course everything depends on the domain. A friend of mine writes software that implements formal methods. Maths, especially logics, is kind of important there.

How about discrete probability distributions generated from log files to drive a simulation of web load on a website (prior to the days of products that can do that for you) ?

Or something much more basic, like calculating the number of seconds to sleep until the beginning of your next timeslot given an interval length and an offset… not rocket science, but tricky enough… (hint, it matters where you do modulus in your equations)

I have made a Venn diagram to illustrate my argument:

http://www.flickr.com/photos/neallindsay/3403808093/sizes/o/

Actually, I think Jeff is slightly wrong. Because there may be more than one way to get the right result(s), but there’s only one right result. So programming is part maths (I have something, and I need to get something else), but part art (oooh, isn’t that lovely looking code, easy to read!)