[math] Is mathematics necessary for programming?

I happened to debate with a friend during college days whether advanced mathematics is necessary for any veteran programmer. He used to argue fiercely against that. He said that programmers need only basic mathematical knowledge from high school or fresh year college math, no more no less, and that almost all of programming tasks can be achieved without even need for advanced math. He argued, however, that algorithms are fundamental & must-have asset for programmers.

My stance was that all computer science advances depended almost solely on mathematics advances, and therefore a thorough knowledge in mathematics would help programmers greatly when they're working with real-world challenging problems.

I still cannot settle on which side of the arguments is correct. Could you tell us your stance, from your own experience?

This question is related to math

The answer is


I feel this question (which I get quite a bit) is best answered with an analogy.

Many of us lift weights. Why? Is it because we're preparing for that day when we become a professional weightlifter? Will we ever encounter the lifting of weights as a job requirement?

Of course not. We lift weights because it exercises our muscles. It keeps us fit and in shape. A fit person will perform better in other areas: hiking, construction, running, sleeping, etc.

Learning mathematics is like weightlifting for the brain. It exercises the mind and keeps it in shape. You may never use calculus in your career, but your brain will be in better shape because of it.


I have a maths degree, but I can't remember requiring that maths a single time in my career. It was useful in terms of training my mind for logical thinking, but I've not written any code using fluid dynamics, quantum theory or Markov Chains. (The last is the most likely to come up, I suspect.)

Most line-of-business developers won't need advanced maths most of the time. Sometimes knowing trigonometry can help, and certainly being able to understand enough maths to implement algorithms described mathematically can be important - but beyond that? Nah.

Don't forget that most programmers aren't advancing computer science - they're building applications. I don't need to know advanced engineering to drive a modern car, even though that car has almost certainly been improved through advanced engineering.


You need math. Programming is nothing more than math. Any findings of theoretical physics does not become a practical(applicable) implication, unless they are explained in terms of mathematical solutions. None of those can be solved computationally if they cannot be interpreted on computers, and more specifically on programming languages. Different languages are thus designed to solve specific problems. But for the general purpose and wide spread programming languages like java, c, c++ much of our programming tasks involve repetitive(continuous) solution to same problems like extracting values from database, text files, putting them on windows(desktop, web), manipulating same values, sometimes accessing some data from similar devices(but given different brand names, different port and a headache) etc which does not involve more than unitary method, and algebra(counter, some logic), geometry(graphics) etc. So it depends what you are trying to solve.


It's not required by a long shot, but...

As a trivial example--Without an understanding of geometry, you couldn't do a lot of stuff with squares and rectangles. (Every programmer has/gets geometry, so it's just an example).

Without trigonometry, there are certain things that are tough to do. Try to draw an analog clock with no understanding of trigonometry -- you can do it, but the process you have to go through is essentially re-inventing trigonometry.

Calculus is interesting. You'll probably never need it unless you design games, but calculus teaches you how to model things that act much more "Real world". For instance, if you try to model a tree falling, to get the speed right at every point along the arch you probably need a good deal of math.

On the other hand, it's just a matter of being exact. Anything you can do with calculus you can probably do with looping and approximations.

Beyond that, to make things even more life-like, you will probably need fractals and more advanced math.

If you are programming web sites and databases, you hardly need algebra 101.


computer science != programming

OK, seriously, I know good and bad programmers who were English and Psychology majors and some that were Computer Science majors. Some very famous guys that I admire as developers didn't have a CS background. Larry Wall(Perl), for example, was a linguist. On the other hand, it helps to know something about the domain you are working on because then you can at least see if your data makes sense and help your customer/users drill down to what they really want. And yes, there's the issue of computational complexity and efficient data structures and program correctness. That's stuff you learn in Computer Science and that's useful to know in almost any domain, but it's neither necessary nor sufficient.


I'll go against the grain here and say "Yes"

I switch from Civil Engineering to programming (Concrete Sucks!). My math background consists of the usual first year stuff, second and third year Calculus(Diff EQ, volume integrations, Series, Fourier and Laplace transforms) and a Numerical Analysis course.

I find that my math is incredibly lacking for computer programming. There are entire areas of Discrete math and logic that I am missing, and I only survive due to an extensive library of textbooks, Wikipedia and Wolfram. Most advanced algorithms are based on advanced math, and I am unable to develop advanced algorithms without doing extensive research (Essentially the equivalent to a half-course worth of work.) I am certainly unable to come up with NEW algorithms, as I just don't have the mathematical foundations as the shoulders of giants upon which to stand.


I used a great deal of math when I was solving problems in solid mechanics and heat transfer using computers. Linear algebra, numerical methods, etc.

I never tap into any of that knowledge now that I'm writing business applications that deliver information from relational databases to web-based user interfaces.

I still would recommend a better math background to anyone.

Discrete math is very helpful to a developer; I have no formal training in it.

I think the techniques laid out in "Programming Collective Intelligence" are far from the stuff I did as an ME and could fall into the business apps that I'm doing now. Netflix has certainly made a nice business out of it. This group intelligence stuff appears to be on the rise.


Statistical machine learning techniques are becoming increasingly important.


The fundamental concept of maths is the following, devising, understanding, implementation, and use of algorithms. If you cannot do maths then it is because you cannot do these things, and if you cannot do these things then you cannot be an effective programmer.

Common programming tasks might not need any specific mathematical knowledge (e.g. you probably won't need vector algebra and calculus unless you're doing tasks like 3D graphics or physics simulations, for example), but the underlying skillsets are identical, and lack of ability in one domain will be matched by a corresponding lack of ability in the other domain.


To answer the question: no.

Mathematical talent and programming talent: strong correlation, little to no causality.

One is certainly not a prerequisite for the other, and beefing up your math skills isn't going to make you a better programmer unless you're programming in one of the specialized domains where math is pretty integral (3D graphics, statistics programming, etc.)

That said, of course a math background will certainly not hurt and will greatly help you in some cases. And as others have noted the thought processes involved in mathematics and programming are quite similar; if you have an talent for one you'll probably find you have a talent for the other.

If I was going to recommend a math requirement for programmers it'd be some basic statistics. Nearly all programming jobs require a little reporting of some sort.

The need for mathematics does increase a little as you start to do more of the advanced and/or fun stuff. Games are pretty math-heavy, so are performance-critical applications where you really need to understand the costs of different algorithms.


My response is absolutely not. I was/am (now unemloyed, thanks India) a computer programmer for 25+ year. And, in my whole career I NEVER encountered program LOGIC that required more than basic math skills. Unless you work with math everyday that exceeds basic math skills, the need for advanced math is nill. At the corporate level any complex math WILL be referred to a statician or mathematicain, who will provide the programmer with the necessary pseudo code, and both will collaborate in the thorough testing of the end product. Ultimately the ball is in the math nerd's court. At any level unless you're a mathmetician/statician/senior programmer the thought of having a programmer responsible for the expected results of a complex advanced math computer program is absurd, and very foolhardy.


Depends on the programming task. I would put 'take data from a database and display it on a website' style programming towards the not-so-much side and then 'video games' on the other side (i work in games and I feel like I use some random different flavor of math every day, and would probably use more if i knew more).


Necessary != Sufficient

Come on guys! the title says "necessary", I would argue that it is at best a sufficient condition to be able to program well. Just like their are many sufficient but not necessary conditions: 5 yrs experience, a CS Degree, or any scientific background.

Some could even argue that being a Poet or English major could make you a good API designer or that an Artist could be good at UI/Web programming.

But these are obviously not guarantees, just like knowing math may not make you a good programmer, but you could hack out some C++ or F# like the rest anyway...


Programming requires you to master, or at least learn, two subjects. Programming itself and what ever domain your program is for. If you are writing accounting software, you need to learn accounting, if you are programming robot kinematics, then you need to understand forward and reverse kinematics. Account might only take basic math skills, other domains take other types of math.


Well you generated a number of responses, and no I did not read them all. I am in the middle on this, no you certainly do not need math in order to be a programmer. Assembler vs device drivers in linux are no more or less complicated than the other and neither require math.

In no way shape or form do you need to take or pass a math class for any of this.

I will agree that the problem solving mindset for programming is quite similar to that of math solutions, and as a result math probably comes easily. or the contrary if math is hard then programming may be hard. A class or a degree or any pieces of paper or trophies are not required, going off and learning stuff, sure.

Now if you cannot convert from hex to binary to decimal quickly either in your head, on paper, or using a calculator you are going to struggle. If you want to get into networking and other things that involve timing, which kernel drivers often do but dont have to. You are going to struggle. I know of a very long list of people with math degrees and/or computer science, and/or engineering degrees that struggle with the rate calculations, bits per second, bytes per second, how much memory you need to do something, etc. To some extent it may be considered some sort of knack that some have and others have to work toward.

My bottom line is I believe in will power, if you want to learn this stuff you can and will, it is as simple as that. You dont need to take a class or spend a lot of money, linux and qemu for example can keep you busy for quite some time, different asm langauges, etc. crashable environments for kernel development, embedded, etc. You are not limited to that, but I dont believe that you have to run off and take any classes if you dont want to. If you want to then sure take some ee classes, some cs classes and some math classes..


Maths is as much about a way of thinking as it is about the skills themselves. And even that lies on several levels. Someone else noted that the analytical and abstraction skills common to maths are valuable to programming and that is one level. I would also argue that there is another level which contains precise analogues that carry from one to the other - for example the set theory behind relational databases, which is all hidden by the SQL semantics.

Very often the "best" - by which I mean most performant and concise - solutions are those which have a bit of maths behind them. If you start to think about your data-oriented programming problems as matrix manipulation, which many are, you can often find novel solutions form the world of maths.

Obviously it is not necessary to be a maths expert in order to program, anyone can be taught, but it is one of the skills that is worth having - and looking for in recruits.


There are some good points to this question in my opinion.

As David Nehme posted here, computer science and programming are two very different subjects.

I find it perfectly possible that a programmer with very basic high-school and early college math skills may be a competent programmer. Not so sure about the computer science graduate, though.

As you correctly pointed out, the algorithm creation process is very much related to how you crunch math. Even if this is just a result of the type of mathmatical and analytical process you must accomplish to correctly design an algorithm.

I also think it very much depends on what you're doing, more than it depends on your job description or skills. For instance, if the programming and math are both tools to produce some effect, than you surely have to be competent with both (i.e.: you are making a modelization programme for some purpose). Although, if the programming is the ultimate objective of your activity, than math is most probably not required. (i.e.: you are making a web application)


No, you don't need to know any math (except maybe binary/oct/hex/dec representations) for system programming and stuff like that.


Business programming: arithmetic, some algebra

Engineering: numerical analysis

Scientific programming: the sky's the limit


I admit that I have never used any advanced math in programming except in some pet projects that are about math topics.

That said, I do enjoy to working together with people that are bright enough to grok maths. Mastering complex and difficult stuff helps to get your brain into shape to solve complex and difficult programming problems.


While advanced mathematics may not be required for programming (unless you are programming advanced mathematics capability) the thought process of programming and mathematics are very similar. You begin with a base of known things (axioms, previously proven theories) and try to get to someplace new. You cannot skip steps. If you do skip steps, then you are required to fill in the blanks. It's a critical thought process that makes the two incredibly similar.

Also, mathematicians and programmers both think critically in the abstract. Real world things are represented by objects and variables. The ability to translate from concrete to abstract also links the two fields.

There's a very good chance that if you're good at one, you will probably be good at the other.


It depends on what you do: Web developement, business software, etc. I think for this kind of stuff, you don't need math.

If you want to do computer graphics, audio/video processing, AI, cryptography, etc. then you need a math background, otherwise you can simply not do it.


Programming is a tool of computer science.

In many area's of programming, math is in the back seat. If you don't know how to quick sort, download a module to do it for you. You don't understand elliptical curves, no problem, buy an AES encryption module.


Now for computer science. Yes, you need higher level math. No doubt about it. Cryptography, operating systems, compiler construction, machine learning, programming languages, and so on all require some form of higher math (calculus, discrete, linear, complex) to fully understand.


I've been programming for 8 years professionally, and since I was 12 as a hobby.

Math is not necessary, logic is. Math is horribly helpful though, to say it's not necessary is like saying that to kill a man, a gun isn't necessary, you can use a knife. Well, it is true, but that gun makes it a lot easier.

There are a couple bare minimums, which you should already meet. You need to know basic algebraic expressions and notation, and the common computer equivalents. For example, you need to know what an exponential is (3 to the 3rd is 27), and the common computer expression is 3^3. The common notations for algebra does change between languages, but many of them use a somewhat unified methodology. Others (looking at you LISP) don't. You also need to know order of operations.

You need to understand algorithmic thought. First this, then this, produces this which is used in this calculation. Chances are you understand this or you don't, and it's a fairly hard hurdle to jump if you don't understand it; I've found that this is something you 'get', and not really something you can learn. Conversely, some people don't 'get' art. They should not become painters. Also, there have been students in CS curriculum who cannot figure out why this does not work: x = z + w; z = 3; y = 5; It's not that they don't understand addition, it's that they aren't grasping the requirement of unambiguous express. If they understand it, the computer should too, right? If you can't see what's wrong with the above three lines, then don't become a programmer.

Lastly, you need to know whatever math is under your domain of programming. Accounting software could stop at basic algebra. If you are programming physics, you'll need to know physics (loosely) and math in 3-dimensional geometry (Euclidean). If you're programming architecture software, you'll need to know trigonometry.

This goes farther then math though; whatever domain you are programming for, you need to soundly understand the basics. If you are programming language analysis software, you'll need to know probability, statistics, grammar theory (multiple languages), etc.

Often times, certain domains need, or can benefit from, knowledge you'd think is unrelated. For example, if you were programming audio software, you actually need to know trigonometry to deal with waveforms.

Magnitude changes things also. If you are sorting a financial data set of 1000 items, it's no big thing. If it was 10 million records, however, you would benefit greatly from knowing vector math actually, and having a deep understanding of sorting at the binary level (how does a system sort alphabetically? How does it know 'a' is less than 'b'?)

You are going to find that as a programmer, your general knowledge base is going to explode, because each project will necessitate more learning outside of the direct sphere of programming. If you are squeamish or lazy about self-learning, and do not like the idea of spending 10+ hours a week doing essentially 'homework', do not become a programmer.

If you like thought exercises, if you like learning, if you can think about abstract things like math without a calculator or design without a sketchpad, if you have broad tastes in life and hobbies, if you are self-critical and can throw away 'favorited' ideas, if you like perfecting things, then become a programmer. Do not base this decision on math, but rather, the ability to think logically and learn. Those are what is important; math is just the by-product.


This is a good answer you don't need to know maths (hell I never go outside basic The Order of Operations: PEMDAS math) haha, yet I always arrive at a solution. SURE back in 1970's math would of been extremely important to programmers who attempted to program for cpu cycle efficiently using very complex mathematical equations to avoid loops and such.

Now computers are powerful a loop to 100 or so to avoid using complex math won't really hurt your program in the long run, but of course you will pickup mathematical skills as a observer without even learning math haha which will improve your efficient programming abilities.

Lets face it the more math you know the more likely you will not only optimize a program better, but you will understand whats possible to program and whats impossible without reading about articles which state thats impossible, because of this crazy mathematical equation.

Learning math can help you go towards understanding how things work without actual EXPERIENCE.. (I base this on my life).

Here is my example (some compression article). I kept trying and trying without understanding the math behind it.. from atleast 700? flawed / failed attempts I now know more of whats possible to do (which may fail again) and also know the 700 flawed ways of looking at it.

If I probably knew math I wouldn't even try those 700 flawed attempts probably due to knowing too much math. But the path I picked without knowing that much math I find much more fun and more educational to me.

But thats just me.. I am always the hands on person.. not the book worm ;)

Some lead to new mathematical breakthroughs others just lead to faster better optimized software.

Let this be a lesson to you guys pick your path whichever works best for you trust me both are rewarding.


In some programming I imagine that math would be most helpful, but not to be a programmer. I'm lucky if I can add 2+2 without my handy dandy calculator.


Two things come to mind:

  • Context is all-important. If you're a games programmer or in an engineering discipline, then math may be vital for your job. I do database and web development, therefore high school-level math is fine for me.
  • You are very likely to be reusing someone else's pre-built math code rather than reinventing the wheel, especially in fields like encryption and compression. (This may also apply if you're in games development using a third party physics tool or a 3D engine.) Having a framework of tried and tested routines for use in your programs prevents errors and potential security weaknesses - definitely a good thing.

I have a degree in math, and I can't say it has helped me in any way. (I develop general web apps, nothing scientific). I enjoy working with other developers with non-math degrees because they seem to think outside my "math" box and force me to do the same.


Systems programming is not rocket science :-) IMHO, any good programmer can approach system programming. However, one need to know

  • Algorithms (this requires little math, but not too much to scare a good programmer),
  • Data structures, and
  • Some (not all) domain knowledge e.g. OS, Architecture, Compilers.

I think the most sought after qualities would be to write precise code and ability go in depth, if required, in any of the above items.

BTW, this is my personal theory, YMMV; I don't consider myself a good programmer yet! :-(


About the only useful things you can learn at university are theoretical.


I agree with Chris. I would say "Yes", also. But this depends on your market as stated above. If you are simply creating some basic "off-the-shelf" applications or writing tools to help your everyday work...then math isn't nearly as important.

Engineering custom software solutions requires lots of problem solving and critical thinking. Skills that are most definitely enhanced when a mathematics background is present. I minored in Math with my Computer Engineering degree and I give credit to all of my math-oriented background as to why I'm where I am today.

That's my 2 cents, I can tell from reading above that many would not agree. I encourage all to consider that I'm not saying you can't have those skills without a math background, I'm simply stating that the skills are side-effects of having such a background and can impact software positively.


I think for tasks you described not too much math is needed. but generally i think for real advanced system programming you:

  • Don't need calculus at all
  • Need good undestanding of computer internals
  • Need CS a LOT and OS theory
  • Need Discrete math (incl. algorythms and combinatorics)


You don't need much math. Some combinatorial thinking can help you frame and reduce a problem for fast execution. Being able to multiply is good. You're an engineer, approximations are fine.


I'm going to sit right on the fence with you here... there are a lot of good arguments both for and against, and all of most of them equally valid. So which is the right answer?

Both...depending on the situation. This isn't a case of "if you're not with us, you're against us".

There are many aspects of math that do make areas of programming much easier: geometry, algebra, trigonometry, linear equations, quadratic equations, derivatives etc. In fact a lot of the highest performance "algorithms" have mathematical principles at their heart.

As Jon pointed out, he's got a degree in maths but in the programming world he barely uses that knowledge. I propose that he does use maths far more than he probably considers, albeit unconsiously...okay, maybe not quantum mechanics, but the more basic principles. Every time we lay out a GUI we use mathematical principles to design in an aesthetically pleasing manner, we don't do that consciously - but we do do it.

In the business world, we rarely think about the maths we use in our software - and in a lot of aspects of the software we write, it's just standard algorithms to complete the same monotonous tasks to help the business world catch up with the technology that's available.

It would be quite easy to skip through a whole career without ever consciously using math in our software. However, having an understanding of maths helps make many aspects of programming simpler.

I think the question really boils down to: "Is advanced math necessary for programming?" and of course, to that question the answer is no... unless you're going to start getting into writing and/or cracking encryption algorithms (which is a fascinating subject) or working with hydraulic equations as Mil pointed out or flow control systems (as I have in the past). But I would have add that while basic math may not be necessary, it will make your life a lot easier.


I used a great deal of math when I was solving problems in solid mechanics and heat transfer using computers. Linear algebra, numerical methods, etc.

I never tap into any of that knowledge now that I'm writing business applications that deliver information from relational databases to web-based user interfaces.

I still would recommend a better math background to anyone.

Discrete math is very helpful to a developer; I have no formal training in it.

I think the techniques laid out in "Programming Collective Intelligence" are far from the stuff I did as an ME and could fall into the business apps that I'm doing now. Netflix has certainly made a nice business out of it. This group intelligence stuff appears to be on the rise.


If you need advanced mathematics in your daily job as programmer really depends on your tasks. I need them. The reason is I have to work with hydraulic calculations for piping systems to evaluate in code the piping system before it gets built. You never want to stand near a collapsing piping system because of under or overpressure. ;)

I guess for many other kinds of 'simulations of the real world' you will need advanced mathematics too.


Two things come to mind:

  • Context is all-important. If you're a games programmer or in an engineering discipline, then math may be vital for your job. I do database and web development, therefore high school-level math is fine for me.
  • You are very likely to be reusing someone else's pre-built math code rather than reinventing the wheel, especially in fields like encryption and compression. (This may also apply if you're in games development using a third party physics tool or a 3D engine.) Having a framework of tried and tested routines for use in your programs prevents errors and potential security weaknesses - definitely a good thing.

To answer the question: no.

Mathematical talent and programming talent: strong correlation, little to no causality.

One is certainly not a prerequisite for the other, and beefing up your math skills isn't going to make you a better programmer unless you're programming in one of the specialized domains where math is pretty integral (3D graphics, statistics programming, etc.)

That said, of course a math background will certainly not hurt and will greatly help you in some cases. And as others have noted the thought processes involved in mathematics and programming are quite similar; if you have an talent for one you'll probably find you have a talent for the other.

If I was going to recommend a math requirement for programmers it'd be some basic statistics. Nearly all programming jobs require a little reporting of some sort.

The need for mathematics does increase a little as you start to do more of the advanced and/or fun stuff. Games are pretty math-heavy, so are performance-critical applications where you really need to understand the costs of different algorithms.


In my experience math is required in programming, you can't get away from it. The whole of programming is based on math.

The issue is not black and white, but more colorful. The question is not whether or not you need math, but how much. The higher levels of math will give you more tools and open up your mind to different paths of though.

For example, you can program if you only known addition and subtraction. When multiplication is required, you will have to perform a lot of additions. Multiplication simplifies repetitive additions. Algebra allows one to simplify math before implementing it into programs. Linear Algebra provides tools for transforming images. Boolean Algebra provides mechanics for reducing all those if statements.

And don't forget the sibling to mathematics, Logic and Philosophy. Logic will help you make efficient use of case or switch statements. Philosophy will help you understand the thinking of the guy who wrote that code you are modifying.

Yes, you don't need much math to write programs. Some programs may require more math than others. More math knowledge will give you an advantage over those who have lesser understanding. In these times, people need every advantage they can get to obtain those jobs.


It's important to keep perspective. Learning math, advanced math, calc, etc. is great for thought processes and many programming positions expect and may make use of math and math concepts. But many programming jobs use little to no math at all.

Computer science, being a math discipline, of course requires lots of math. But few programming jobs are derivatives of comp sci. CS is a very specific discipline. There is a reason why IT schools now have Software Engineering as a separate discipline from CS. They are very different fields.

Comp Sci, for example, does not prepare you well for the world of most web applications. And software engineering does not prepare you well for compiler design and kernel development.


To do what you want, you do not have to know math, but you have to like it a lot.


You don't need to learn math for programming.

But learning math trains you in thinking discipline. Therefore I would consider math to be good for the developers.


I have two math degrees. I wish I knew more about databases.

My point is, while being able to find the roots of a polynomial or being able to prove that sqrt(2) is irrational is useful in an abstract sense but won't necessarily make you a better programmer.


Mathematics are needed for developers in some fields but are almost useless in others.

If you are a game developer and have to work with physics a lot - understanding of math is crucial. If you are working with advanced visual controls - you could not do much without geometry. If you're planning to do some financial calculations - it would REALLY help to have solid knowledge of statistics.

On the other hand over last 5 years I had only 2 or 3 projects where ANY amount of math was required at all. Of these there was only 1 occurrence when a Google search did not help.

At the end of the day even financial calculations are very often something your clients do for you and give you formulas to implement.

So if you're in 'applied software' business you are likely to never use your math degree. If you're in academic software maths are crucial.


There are plenty of programming tasks that can be done well without a background in advanced math. It is probably safe to say the majority of programming jobs available will rarely require anything more than high school level math. But you are not going to write the software that helps put the shuttle in space by hacking away with your freshman college algebra math level. So, while advanced math is usually not vital to many programming tasks the more difficult problems will absolutely require it. Studying math also teaches valuable problem solving skills that can be used almost anywhere. I guess you could say it's not necessary most of the time, but it's certainly going to help almost all of the time.


I think it really depends on what you're trying to do, but IMHO, the CS and OS theory are more important than math here, and you really need only the math that they involve.

For example, there's a lot of CS background of scheduling theory and optimization that stands behind many schedulers in modern OSs. That is an example of something that would require some math, though not something super complicated.

But honestly, for most stuff, you don't need math. What you need is to learn the ability to think in base 2 and 16, such as the ability to mentally OR/AND. For example, if you have a byte and within that byte there are two 3-bit fields and 2 wasted bits, knowing which bits are in which fields are active when the byte value is something like 11 will make things slightly faster than having to use pen and paper.


It depends on what you do: Web developement, business software, etc. I think for this kind of stuff, you don't need math.

If you want to do computer graphics, audio/video processing, AI, cryptography, etc. then you need a math background, otherwise you can simply not do it.


IMO, you probably need an aptitude for mathematics, without necessarily having much knowledge in the field. So the things you require to be good at maths are similar to the things you require to be good at programming.

But in general, I can't remember the last time I used any sort of advanced maths in day-to-day programming, so no.


If you find the subject fascinating enough to post this, just go ahead and start learning. The rest will come naturally.


I would argue that having advanced logic (discrete) math can really help. That along with set theory. When dealing with common computer programs, these disciplines can help a lot. However, a lot of the other math I took in university was calculus, which as far as I can see, had very limited usage. Since 90% (or something like that) of programming is doing business apps with very simple math, I would say that for the most part, you can get by with very little math knowledge. However, a good understanding of boolean algebra, logic, discrete math, and set theory can really put you up to that next level.


Of course it depends on what kind of programmer you want to be, or better what kind of programmer your employers want you to be. I think calculus and algebra are essentials, statistic and linear programming is indeed a good tool to have in your briefcase, maybe analysis (derivative, integrals, functions...) could be done without. But if you want to know how things work skin-deep (electronics, for example, or some non trivial algorhytms) "advanced" math is something you'd better not go without anywhere.


Certian kinds of math I think are indispensible. For instance, every software engineer should know and understand De Morgan's laws, and O notation.

Other kinds are just very useful. In simulation we often have to do a lot of physics modeling. If you are doing graphics work, you will often find yourself needing to write coordinate transformation algorithms. I've had many other situations in my 20 year career where I needed to write up and solve simultanious linear equations to figure out what constants to put into an algorithm.


Someone with a solid mathematical (which is not merely arithmetic) or logic background will cope well with algorithms, variable use, conditional reasoning and data structures.

  • Not everyone can design a UI.
  • Not everyone can make efficient code.
  • Not everyone can comment and document clearly.
  • Not everyone can do a good algorithm

Mathematics will help you to a point, but only to a point.


I dont think advanced mathemetics knowledge is a requirement for a good programmer, but based on personal experience I think that programmers who have a better grasp at advanced maths also make better programmers. This may simply be due to a more logical mind, or a more logical outlook due to their experiences of solving mathematical problems.


At the university we read the book "Concrete Mathematics" by Knuth, Graham and Patashnik. This is a math book with topics selected for computer science students. Several year later, I checked the book again and noticed that I've used every single topic in the book at least once (with the exception of Stirling numbers).

In most cases knowing some math helps to solve problems with less work, more elegant or to implement faster solutions. It also depends on the kind of work you are doing. I.e. math is more important when you concentrate on algorithms, than when you concentrate on engineering problems.


I guess I am going to be the first person to say you do need math. As others have said math is not all that important for certain aspects of development, but the fundamentals of critical thinking and structured analysis are very important.

More so, math is important in understanding a lot of the fundamentals that go into things like schedulers, optimizations, sorting, protocol management, and a number of other aspects of computers. Though the math involved from a calculation level is not complex (its mostly High school algebra) the theories and applications can be quite complex as a solid understanding of math through calculus will be of great benefit.

Can you get by without it, absolutely, and you shouldnt let a less then thorough knowledge of math hold you back, but if you had the chance, or the inclination I would study as much math as you could, calculus, numeric theory, linear algebra, combinatorics, practical applications, all of it has both practical and theoretical applications in a wide range of computer science.

I have known people who were highly successful on both sides of the fence (those without a strong focus on math, and those who went to school for physics or math), but in both groups they enjoyed numerical problems and learning about algorithms and math theory.


Most of the programming I have done involved physics simulations for research including things like electromagnetism, quantum mechanics and structural mechanics. Since the problem domains have advanced mathematics associated with them I would be hard pressed to solve them without using advanced mathematics.

So the answer to your question is - it depends on what you are trying to do.


I don't think that higher math is a requirement for being a good programmer - as always it depends on what you are coding.

Of course if you are in 3D graphics programming, you'll need matrices and stuff. As author of business software, you'll probably need statistics math.

But being a professional programmer for almost 10 years (and another 10 years amateur) "higher math" is not something that I needed regularily. In about 99.8% of all cases it's just plus, minus, division and multiplication in some intelligent combinations - in most cases it's about algorithms, not math.


Math is a toolbox for creating programs. I recommend Cormen's Introduction to Algorithms. It touches on the more "mathy" stuff.

- Greatest lowest limit (managing resources) 
- Random variables (game programming)
- Topological sort (adjusting spreadsheets)
- Matrix operations (3d graphics)
- Number theory (encryption)
- Fast fourier transforms (networks)

I have a degree in math, and I can't say it has helped me in any way. (I develop general web apps, nothing scientific). I enjoy working with other developers with non-math degrees because they seem to think outside my "math" box and force me to do the same.


In my experience the Math requirement for a Computer Science degree exists simply to weed out those who will fail. If you cannot pass Calculus I and II you will most definitely not pass an advanced course on compiler construction, database or operating systems theory.


I began programming about the same time I entered my pre-algebra class.. So I wouldn't say math is all that important, though it can help in certain types of programming, especially functional.

I haven't taken Discrete Math yet, but I see a lot of theory stuff with programming written in a math-notation that is taught in this class.

Also, make sure you know how to calculate anything in any base, especially base 2, 8, and 16.

Also, one class that really brought home some concepts for me was this pre-programming class. We got taught unions, intersections, and all that happy stuff and It almost exactly parallels bitwise math. And we covered boolean logic very heavily. What I considered the most useful was when we learned how to reduce complex boolean statements. This was very handy:

(x|y) & (x|z) & (x|foo)

can be simplified to

x | (y & z & foo)

Which I previously did not quite grasp.


I work as a game programmer, in a team with artists, game designers, level designers, etc.

Having someone on the team who knows some maths is a net plus, just as it is a plus to have someone who plays all kinds of games, someone who'se a representative member of our target audience, someone who lived through some painful productions, etc.

Often, the ones who know the most maths will be programmers (sometimes game designers), because the domains are close enough. But, day to day, game programmers don't need much maths beyond 3D geometry and (sometimes) physics.

Among the maths I studied, I found statistics the most useful, though I sometimes find myself missing some concepts.


As a self taught programmer who started working on games about 30 years ago I would definitely say you need to get as much math as you can. Things like matrices, quaternions, ray tracing, particle systems, physics engines and such do require a good level of math comprehension and I only wish that I had learned all those things much earlier.


For your general GUI and Web applications only basic mathematics knowledge will ever be needed.

Once a lifetime you might have an odd project where you need calculus or linear algebra.

(If you do 3D game programming or some other specific field of programming, you might need it everyday thou)


Learning higher math, for most programmers, is important simply because it bends your brain to think logically, in a step-by-step manner to get from one thing to another.

Very few programming jobs, though, require anything above high school math. I've used linear algebra once. I've never used calculus. I use algebra every day.


Discrete math I found very helpful. I took Calculus, and there are some times it might have been very helpful too, but I don't remember any of it. For instance, the time I was trying to implement a DIS interface (which deals with things like rotational velocities and coordinate transformations). I spent a day driving all over town looking for a book to explain quaternions to me (this was pre-WWW). There was also a time I ended up needing to write a facility for some engineers to impliment n-linear interpolation. If you have no clue what that means, believe me I didn't either. Fortuntely, that was post-WWW.

My advice is to not sweat it. You may be hamstrung on a project or two, but not all that badly these days.


Nope, don't need math. Haven't done any since I graduated, and probably forgotten what little calculus I mastered anyway.

Think of it like a car. How much math/physics do you think is behind things like traction control and ABS braking? Lots. How much math do you need to know to use those tools? None.

EDIT: One thing to add. Industry is probably important here. A programmer working at a research firm, or writing embedded traction control systems for that car, is probably far more likely to need math than your average business tool programmer.


Yeah, there is no need for advanced mathematics - if you are programming commercial - off the shelf software.

However when dealing with hardcore stuff such as:

  • Calculating trajectories to control a robot
  • Creating AI-like applications to support uncertainty and automatic reasoning
  • Playing with 3-D motion and graphics

Some advanced mathematics knowledge might come in handy. And it's not like they are "out-of-this world" problems.

I had to create a software to try to "predict" the necessary amount of paper for an office (and it was hell just to find out the best way to approximate values).

You have to be careful, though, because it is easy to get lost when using advanced things - there is a friend of mine who resorted to using Turing to store the state of a dynamic menu just to display it correctly - humm... perhaps he wnet too far in his imagination.


It depends on what you are doing. If you do a lot of 3D programming, knowledge of 3D geometry is certainly necessary, don't you agree? ;-) If you want to create a new image format like JPG or a new audio format like MP3, you are also pretty lost if you can't understand a cosine or fourier transformation, as these are the basics most lossy compression are based on. Many other problems can be resolved better if you know your math rather well.

There are also many other programming tasks you will find do not need much math.


See also Is Programmng == Math? from stackoverflow.

While I don't think it's required for programming, I can't tell you how many times I've been able to use linear algebra concepts to write a clear and short solution to replace a convoluted (and sometimes incorrect) one. When dong any graphics or geometry (and even some solver) work, knowledge of matrices and how to work with them has also been extremely useful.


Mathematical knowledge is often useful to a programmer, as are graphic design skill, puzzle-solving ability, work ethic and a host of other skills and traits. Very few programmers are good at everything that a programmer can possibly be good at. I wouldn't agree with any statement of the form "you're not a real programmer unless you can {insert favorite programming ability here}".

But I would be wary of a programmer who couldn't do Math. More so than of one who couldn't draw.


What type of programming?

In my commercial experience, I have needed no advanced mathematics, but this is heavily dependent on the field you are in.

Computer graphics require a large amount of advanced mathematics. A lot of academic computer programming requires advanced mathematics.

So saying there tends to be a correlation between people who are good at mathematics and people who are good at programming.

I hope this wishy-washy answer helps.


Certian kinds of math I think are indispensible. For instance, every software engineer should know and understand De Morgan's laws, and O notation.

Other kinds are just very useful. In simulation we often have to do a lot of physics modeling. If you are doing graphics work, you will often find yourself needing to write coordinate transformation algorithms. I've had many other situations in my 20 year career where I needed to write up and solve simultanious linear equations to figure out what constants to put into an algorithm.


I'm going to sit right on the fence with you here... there are a lot of good arguments both for and against, and all of most of them equally valid. So which is the right answer?

Both...depending on the situation. This isn't a case of "if you're not with us, you're against us".

There are many aspects of math that do make areas of programming much easier: geometry, algebra, trigonometry, linear equations, quadratic equations, derivatives etc. In fact a lot of the highest performance "algorithms" have mathematical principles at their heart.

As Jon pointed out, he's got a degree in maths but in the programming world he barely uses that knowledge. I propose that he does use maths far more than he probably considers, albeit unconsiously...okay, maybe not quantum mechanics, but the more basic principles. Every time we lay out a GUI we use mathematical principles to design in an aesthetically pleasing manner, we don't do that consciously - but we do do it.

In the business world, we rarely think about the maths we use in our software - and in a lot of aspects of the software we write, it's just standard algorithms to complete the same monotonous tasks to help the business world catch up with the technology that's available.

It would be quite easy to skip through a whole career without ever consciously using math in our software. However, having an understanding of maths helps make many aspects of programming simpler.

I think the question really boils down to: "Is advanced math necessary for programming?" and of course, to that question the answer is no... unless you're going to start getting into writing and/or cracking encryption algorithms (which is a fascinating subject) or working with hydraulic equations as Mil pointed out or flow control systems (as I have in the past). But I would have add that while basic math may not be necessary, it will make your life a lot easier.


Advanced maths knowledge is vital if you're going to be writing a new programming language. Or you need write your own algorithms.

However, for most day-to-day programming - from websites to insurance processing applications - only basic maths are necessary.