tags:

views:

460

answers:

10

Is it important for developers to know discrete math? Most of the books about algorithms and analysis have at least some references to math. I can easily understand the algorithms in principle and can implement them without any problem, but when it comes to the math parts I get stuck. Is it generally assumed that developers will have deep knowledge of math to understand algorithms and methods?

+2  A: 

Depends on what the developer is doing probably. If you are doing web, probably not, maybe a bit when it gets to security. Like the time a brute force attack takes to decode a key of certain number of bit under a certain hash. If you are doing graphics for high end games, you probably need to understand quite a bit of maths and the pros and cons of the methods. As a DB admin or network, you shouldn't.

Vass
A DB admin could profit from knowing some queueing theory.
Peter G.
@Peter G: And networking is basically pretty much exclusively queueing theory. It is no accident that the primary programming language for telecom networks is named after the inventor of queueing theory.
Jörg W Mittag
A: 

If your job is pure CS like Google search where you invent new algorithms then yes, you'll need to be able to analyse running times quite well, also anything sciency like physics simulations. If you're a 'normal' developer then you'll need to know about running times and what they mean and their impact on your application.

James
Yeah of course I can figure out the running times and impact ... at least for standard algorithms. But this is not the only requirement.
NixDev
+13  A: 

It depends on the kind of developer you're talking about and the kind of math you're talking about. I'm pretty sure that most of the "ordinary" developers don't need to know much about math. But, do you want to be "ordinary" developer?

  • If you're developing web applications that just display and allow editing of data in database, then you'll probably never need any math.
  • On the other hand, if you're developing a GPS system that shows a path to the target (or some other application that does more complicated calculations) then discrete math is going to be useful.
  • It doesn't necessarily be discrete math though - for example, in the finance industry, people need probability and statistics far more often.

That said, knowing math will definitely make you a better developer, because it trains your mind in a way that is useful not only for solving specific (math) problems, but also teaches you how to think about problems in a more formal fashion (which, I believe, is important for writing correct code).

Tomas Petricek
When is a GPS system ever going to not involve continuous mathematics?
Gian
Well... and what is the learning path ?
NixDev
@Gian: I wasn't clear - I was thinking about finding a path in a graph (or similar graph based discrete math problems)
Tomas Petricek
@NixDev: I'm not sure what's the best way to learn math (e.g. discrete math) on your own. I think it may be a good idea to look at some of the lectures online (if there are any available on this topics). Look for example at: http://videolectures.net
Tomas Petricek
@Thomas thank you for the link.
NixDev
A: 

My experience is this:

Knowing something about discrete mathematics is something you will never regret. It will make your job easier in many instances, even in mundane tasks, because you will be familiar enough with various concepts that will at least allow you to construct a smarter google query. In depth familiarity and ability to do these things by rote is probably not helpful to most programmers, but a passing familiarity definitely is.

That said, most programmers in industry that I've encountered (and even some in academia!) know almost nothing about this stuff, so not knowing it is unlikely to place you at a significant disadvantage outside of a few specialist programming sub-disciplines.

Gian
A: 

You're generally not expected to have a deep knowledge of maths, unless the application requires it - e.g. you're writing financial software, or doing some 3D modelling, load balancing on aircraft, writing some tailored compression algorithm etc. I've worked with great developers who struggled with simple maths. And knowing discreet maths seems very specific. Having an understanding of how a variety of algorithms work can be helpful, and if you can do that it doesn't much matter that you can't construct a proof of their optimality etc.

To be honest what I think is most important is understanding the business you're building for, and how you approach writing code (readability, modular etc)

Greg
+7  A: 

Yes.

I find that discrete math is fairly core to computer science. Understanding set theory, boolean algebra, maps, etc. are all beneficial to a developer and are all part of discrete math.

Of course, the concepts won't always be applicable in the most academic sense. You will almost never open your discrete math textbook and copy something into your code to solve a problem. However, understanding those concepts will help developers write better code, better algorithms, and use design patterns more effectively.

John Gaughan
Ok, but is knowledge of Computer Science core to software development. I don't believe it is.
John Saunders
I believe it is. Maybe not every developer needs a CS background, but every project does. My job entails taking customer requirements that can be quite complex and finding elegant solutions to them. Without a CS degree, most people would fail at this task. When I am done, I turn over the design to an outsourced group that essentially churns out the code. They don't understand CS, discrete math, etc. -- but I do.
John Gaughan
Have to say I agree with John Saunders, it really depends on what you're doing, if you're doing development with a high level dynamic language, intricate knowledge of CS is likely not necessary, the higher the level languages get, the simpler it becomes to do things that previously were more complicated, sure they are less efficient in terms of machine usage but this is a tradeoff for increased programmer productivity, and it depends on what type of project to really be able to definitively say whether an in-depth knowledge of CS is really all that necessary.
Rick
A: 

Some knowledge of discrete math might someday help you stop before spending a lot of time attempting to code up something mathematically impossible or of NP complexity to solve. You will gain a much better "feel" for when some proposed software problem or solution path more resembles an easy homework assignment, or one of those term projects which no one in your class ever completed.

hotpaw2
+1  A: 

The kinds of problems that you get the chance to solve depends on what you know.

If you only know 4th grade math, you'll only be asked to solve problems that involve math that's at a 4th grade level or less.

If you aspire to do more or understand the underpinnings of other algorithms, you'll have to learn whatever math is necessary.

I think you'll find that working through the points where you get stuck will improve your math, your appreciation for the problems you solve, and a better chance at extending the math you learn to new areas.

It nauseates me to hear people immediately disparage an area that they find difficult, as if to justify their unwillingness to push past the pain of ignorance and struggle. Learning any new skill requires that you push through that barrier, be it math or anything else. I'd advise you to stay with it and prove to yourself that you can master something difficult by resisting the urge to give up.

duffymo
+1  A: 

You have already found out that the results of discrete mathematics are useful in programming. My experience is that understanding why something works, rather than attempting to simply follow it by rote, allows you to find and fix many errors and misunderstandings. It also allows you to handle situations that are almost, but not quite, the way they are in the textbook, and to realise when the textbook answer no longer applies. Time spent understanding even a small part of something that you might use or work on will not be wasted.

mcdowella
A: 

It depends about what part of discrete math you are talking. Of course knowing math will always be an advantage... but I think that knowing of some parts of discrete math are not just advantage, but are very essential for a developer (of course it depends from projects on which he/she is working).

But topics like :

  • Set theory
  • Graph theory
  • Alg. Analysis
  • Alg. Complexity
  • Sorting
  • etc...

are essential for a developer.

NDeveloper