views:

505

answers:

9

Possible Duplicate:
Is mathematics necessary for programming?

Why is the above a duplicate - I academically speaking would like to know HOW mathematics helps one program so some more teaching could be put in to modern CS and engineering degrees NOT if it is necessary.

A lot of my colleagues have backgrounds in Mathematics, some to PHD level, I was just wondering what it is about Mathematics that lends itself to making better programmers. Perhaps some subset of this teaching could be extracted and taught in other more engineering based degrees. Or perhaps its not the Mathematics itself that makes better programmers but the skills gained in embarking on a course of study.

Edit: for those posting irrelevant duplicate links - I'm interested in the how not "does math make me a better programmer" etc...

+1  A: 

I'm not certain a background in mathematics is terribly useful to programming as a whole. Some of the concepts are useful, especially considering discrete math (logic), but overall I think general engineering (e.g. problem-solving) skills are more applicable to programming than straight-out mathematical skills.

Matthew Jones
+2  A: 

This very much depends on what you are doing. For some low level stuff (data structures, search, etc) it helps you think in useful ways. In other areas (GUI, pluming, boilerplate coding) it doesn't help much at all.

BCS
+1  A: 

Math makes one a better programmer because programming is based on Math/Logic. Those who started programming were people with Math backgrounds. There is plenty of Algebra in programming as well.

Chances are if you like Math, you'll do well in programming, although the two are not mutually exclusive.

pave
A: 

To a certain extent, mathematics == algorithms, especially if you are doing functional programming.

If you were to survey a random selection of programmers, you would find that there is a greater proportion of them than there is in the general population who are also musicians. Music is also firmly grounded in math.

Which is not to say you need to be a math major to be a good musician (or programmer, for that matter), but that the fields (and the aptitude) are conceptually related.

Robert Harvey
Yes I suppose it depends a lot on the domain in which you are working.
codingfloor
I see you added a disclaimer, because "music is firmly grounded in math" isn't qualified enough for me. There are plenty of gifted composers (I'll leave out people who are merely e.g. good singers but can't create music) who are mathematically ignorant. If you mean that some of the mental attributes that make them good musicians might also make them good mathematicians, then I agree. If you mean that some aspects of what makes sound "music" can be described mathematically, then I also agree.
wrang-wrang
I mean both of those things.
Robert Harvey
A: 

I think Mathmatics teaches problem solving skills which is obviously useful in programming as one is constantly problem solving. I am self taught programmer with 12 years experience and I was really bad at math, this was probably because I didnt apply myself at the time. I would say no it doesnt make somebody a better programmer as programming can be about process and logic. If one is very mathematical, then I guess one may explore other areas, like hard core graphics, crypography, file compressions etc.

Mark Redman
A: 

You don't need to know calculus to program. If you do know calculus, then you can write useful applications to solve equations.

However, you do have to understand the process of setting up and evaluating mathematical statements. Code is just fancy math operations.

mcandre
+6  A: 

Speaking from a student's perspective, everything in the curriculum at my school is taught in a mathematical fashion. Algorithms is rather obvious, but in AI we were lectured on (but thankfully not tested on. :)) why certain learning algorithsm could converge. Much of AI (state transitions, learning, logic [of course]) is set in rigid, formal constructions that are quite math-like. My low-level systems course started from building logic gates, and then we implemented adders with logic gates and such --- not really calculus or combinatorics, but I think to like that sort of stuff requires liking math as well. Statistics and probability is used often (I say this from impressions, not from experience) in signal processing and such, and let's not even get started on quantum computing. :)

Furthermore, I think really well-thought-out programs -- for schoolwork, at least -- are best approached in a manner akin to proving something. This may be my own take on things, but it seems that the thought processes for "how do I get my program to do X" is not dissimiliar to "how do I prove Y?" (note that x and y can be different). And hey, in that example, I'm using variables!

TL;DR: Academic CS is very much linked with mathematics, and mathematical thinking. My approach to programming involves very math-like thinking, and I doubt I'm alone in that. Thus, it simply seems to make sense that there is a heavy intersection between math degrees and programming professions.

Agor
+1  A: 

There are some great algorithms published that are only described in a very formal, mathematical way. If you're unwilling to invest in understanding mathematical notation, then you'll not benefit from these.

It's unlikely that you'll develop usefully new and correct algorithms without the ability to digest the existing papers.

If you have basic paper-deciphering skills, and are really willing to learn about a math topic when needed instead of giving up and skipping the paper, then that should be enough in theory. In practice, not every paper spells out the name of the notation it uses so that you can easily search for its meaning.

You could spend a productive lifetime programming in areas where you're barely suffering from a lack of formal math literacy. But without it, you lose:

1) The fun of implementing really amazing computations (if you've experienced this, you know it's at least comparable to "look at this fun interactive multimedia widget I made!"

2) The ability to prove your new algorithm correct - more practically, increased likelihood of being able to read code and rightly judge its correctness. Randomized testing is not necessarily sufficient for hard optimization problems!

3) Effective use of the algorithms literature.

4) If you're mathematically competent, you'll have no problem understanding the semantics of languages with elaborate type systems (which is not to say that it's always easy to understand the behavior of a given program).

wrang-wrang
+1  A: 

If you've thought a lot about mathematics, you understand the difference between a thing and its name. Year after year I see people get completely lost -- in many aspects of life, but especially programming -- because they couldn't keep that distinction straight. Changing the value in a register does not neccessarily change the entity which the value is supposed to describe. Redrawing a graph can make it easier to read, but it can't change the facts that went into it. If the right person calls this "version 4.0", then that's what it is, but that doesn't make it new.

Honestly, after you see otherwise intelligent people make this mistake enough times, you start to see politics, romance and religion in a new light.

Beta