views:

1515

answers:

16

I am sure many developers here -- at least the ones who were formally trained -- took a fair amount of math courses in the university. Some minored in mathematics. The curriculum usually included Calculus (level 1, 2 and 3), linear algebra, probability/statistics. As a computer scientist, I have barely used any math whatsoever in the last 5 years. And now, with a job change, where math is becoming more relevant, I'm forcing myself to re-learn this forgotten craft.

Is that common among the fellow developers (let's exclude researches and work academia for the time being) that MATH NOT present at their job? How do you get back on track when your new employer requires a knowledge?

From now on, I am considering to keepa certain math subjects up to date? Which ones would you recommend?

What math any computer scientist should know?

Note: I am using a software developer and computer scientist interchangeably, and generally refer to developers who create software.

+2  A: 

That depends a lot on what you do.

My use of math is limited mostly to understanding the source of rounding errors and properly handling them.

A friend of mine went to work for a game company. He uses 3D math from time-to-time, but the tools and libraries deal with most of the hard math these days (if he were writing the next, great tool or library this would be very different).

A second friend went to work for a university and is modeling the first 10^-12 seconds of the universe after the big bang. He uses crazy-difficult/obscure math all of the time (even though excluded from the question... wanted to add for completeness).

Eric J.
+2  A: 

I think the answer largely depends on the domain you will be working in but discrete mathematics is a good basis. See http://www.amazon.com/Discrete-Mathematics-Computer-Science-Curriculum/dp/1930190867 for a nice book about the subject.

olle
+2  A: 

Just because I majored in computer science doesn't make me a computer scientist. I am a software developer (actually more of a system analyst. The two often have nothing to do with each other. In my career to date, I use almost not math whatsoever. In fact, I use so little that I often have trouble determining the tip to give a waitperson.

John Kraft
While a student at caltech, we had a standing rule. The tip, as well as any splitting of the check, was calculated by the youngest non-math major. Youngest because its a burden, but non-math because we all knew that the math folk often couldn't do arithmetic.
RBerteig
+11  A: 

It think that the point that a lot of math is in included in computer science courses is not only that you apply the math, but that you develop a certain mindset and a certain way of thinking.

In my opinion, a lot of developers use the logical and abstract way of thinking that is learned with math without realizing it, since it has become "a second nature". Often you see that good developers can easily learn math and people who are good in math can easily learn programming.

Henri
Concerning your last sentence - I think that beyond the basics, this is not true at all. I had math as secondary subject, and I once told a professor of a pure math lecture (group theory) that the part I liked best was when we did an algorithm (for enumerating co-sets), becuase as a CS major, that's bread-and-butter to me, while proving theorems was very hard for me. He laughed and said that was the part most math majors had problems with.
Michael Borgwardt
Micheal, i see your point but that is not what I meant. What I meant was that people who do math, can more easily learn programming than people who are not. I'm pretty sure that learning the average management guy to programming will take much langer than learn the average mathematician to program. This is not because managers are stupid, but because their brain has developed in a very other direction compared to mathematicians (and any other technical study for that matter)
Henri
@Henri: Interesting discussion. While I'm inclined to agree, I've met quite a few mathematicians who either became programmers or teachers of programming, and (IMHO) they are not very good at it. They don't "get" the basically engineering concepts of pragmatism and discipline that go into it.
Mike Dunlavey
+5  A: 

Your use of math in computer science depends, as the other answers point out too, largely on exactly what within the field of computer science that you do.

I have found that my need for math skills is not so high when I'm working with high-level libraries and frameworks - for example, when programming ASP.NET MVC web sites, the .NET framework does a lot of the job for you, because the things you can be expected to do often (and thus almost all the things I do in the web project) are already built and included in the framework.

On the other hand, when I sit with Project Euler problems in my free time, I find myself wanting. Higher skills in both the fields of math and "algorithm design" (for lack of better word for it) would definitely make things easier.

The same thing goes for writing code that is not as high level, or that requires extreme optimization. Being able to make use of handy shortcuts etc helps a lot, but one needs to be able to prove that it will still do the job. Math enables that.

So to summarize: The "higher" level code you write, and the more you work with complete frameworks designed for a specific area, the less you'll need advanced math. To answer your question about what areas to "keep up", I'd say Discrete Mathematics as a first priority, and Numerical Analysis as a second. Maybe a course or two in basic datalogy isn't bad either, as it will help you keep in mind how things work "under the hood" even if you don't specifically need it right now...

Tomas Lycken
+1 Project Euler is a great way to humble your high-level framework of choice and also let you know how much Math you don't know.
rick schott
A: 

Like others have said, it really depends on what you are doing. Most developers are not in "Computer Science", they develop business apps. I work in motion control and image processing, so I have to know a fair amount of math to do my job.

Ed Swangren
+1  A: 

nth-ing the "developers and computer scientists are only tangentially related" sentiment.

I used a bit of 3D math when working for a game company, but in my day-to-day work I use almost no math at all. Any math I need is done by Excel. There are a few exceptions, but it really depends on what you're developing. I worked for a company that did navigational software for sea vessels (Navy, Coast Guard, stuff like that), and the developers there use math quite a bit. Any sort of simulation software would use math quite extensively. Writing the next StackOverflow? Very likely not much math involved.

Chris Simmons
+2  A: 

Depends what field of development you're in. I have a CS degree and became a web developer. When I worked in finance, math came up more because we were calculating derivatives, etc.

These days I work at a digital ad agency doing backend work mostly. Advanced math doesn't come in often for me, but I did find that having a good understanding of Linear Math, Discrete Math, and basic Calc I has been useful in deciding how to code pages for high performance (no, you can't just cache everything). My math background gave me a deeper understanding of how a few hits on a server calling a poorly architected backend could cause the CPU to max out. For example, if I'm calling a sorting algorithm on each request; do I want to use quicksort(n^2 worst case, but on average is NLogN) or say merge sort (which is nlogn worst case). Because of my background in math, I easily understand which algorithm provides more consistent performance and can choose the appropriate sorting algorithm. I know that if I'm regularly dealing with large values of N, I definitely want to go with mergesort; since if I have a large value of N and it happens to be a dataset that causes quicksort to perform at N^2, my CPU usage could spike heavily. Multiply that by a few similar concurrent requests, and you have a site that will occasionally perform poorly; because you didn't understand the difference between N^2 and NlogN. I know this because I have a solid foundation in Linear Algebra and Calc I. It might not have seemed all that relevant when I was learning it at the time; but now I'm glad I had to learn it.

Frank Rosario
A: 

It really depends on what kind of development you are doing. If a person does not have strong math skills, I would not encourage a career in computer science.

Basically, every day you use concepts from Algebra like Order of Operations even though you aren't expressly using Algebra per se.

Software development is very logical. Many of the problems you solved are solved in a somewhat similar manner to the way you might work complex math problems.

Anthony Gatlin
+1  A: 

Part of me wants to question what we call Math here. Does situations involving numbers alone constitute using Mathematics? For example, counting how often a loop gets executed or the size of some collection count as using Math. I don't know, I just think it a worthwhile question.

In terms of more complex Math, I think I still use statistics on a regular basis, looking at data and interpreting that data for trends and patterns. I don't think I use Calculus or Linear Algebra all that much, but some Boolean Algebra will pop up in terms of ordering parts of a condition or thinking about how I want the program to flow. While I would like to use my Combinatorial Optimization or Asymptotic Enumeration skills, these just don't easily apply to basic web development in my world.

JB King
+1 for mentioning Boolean Algebra. Incredibly useful. I haven't used Calculus since college, but as others have said, "it depends."
TrueWill
+2  A: 

How much math do you use as a computer scientist?

I once asked that question here, and various people answered.

Is that common among the fellow developers (let's exclude researches and work academia for the time being) that MATH NOT present at their job?

Yes it's common, with the following exceptions:

  • Some of the skills that are needed for math (e.g. using abstraction, symbols, and induction) are also used in programming

  • Some (or, many) of the problem/application domains for which people do programming require maths itself (e.g. engineering, physics, cryptography, finance, statistics, and signal processing)

What math any computer scientist should know?

If you mean "software developer" not "computer scientist", then the answer IMO is "very little"; they should know:

  • Orders of magnitude (e.g. the difference between Kbyte and Mbyte, msec and nsec)

  • "Big-O" notation

ChrisW
A: 

Let me echo everyone who says, basically, "it depends on the problem domain you work in".

On top of that, I've met some very good programmers who can examine a problem and come up with much simpler design approaches than others might, and I think that is basically a skill that comes from mathematics. (Though a degree in math does not guarantee you can do it, by any means.)

Another skill that comes from science / math is the ability to separate common wisdom from truth. In this field, if something is really true, then there is a scientific reason why, even if the reason is not yet known, and if there isn't a reason why it's true, it's not true. It's not in-between. A math / science background can encourage one to do that kind of questioning of common wisdom, often with valuable results.

Mike Dunlavey
+1  A: 

What an interesting question.

From one point of view, every program is a large mathematical expression. Adding strings together is still a mathematical symbolic operation, it's just not Arithmetic in the usual sense of the word.

Computer Science is also not exactly mathmematics. There are many easily-coded programs (Cellular Automata like "Life" or "Langton's Ant" being prime examples) that are still largely outside of the common language of mathematics, in the sense that you can do meaninful and predictive symbolic manipulation with them rather than just crunch the numbers. A lot of very intresting and important computer science problems are simply 'intractable' to a mathematician.

But knowing your math is essential to good algorithm design. I spend a lot of time programming 'on the edge', on systems which push the boundaries. Them math helps me know that what I'm attempting is feasible. It allows me to make correct predictions.

++ Welcome to SO !
Mike Dunlavey
+7  A: 

It depends on what you mean by "math." If by "math" you mean the stuff you learned in high school and college (algebra, calculus, linear algebra, etc.), then it would depend on your specific application. Someone who works with numbers a lot is likely to need some of the higher math.

But more generally, any time you program a computer you are doing math. See, math is not just numbers, variables, and a handful of operators. Math is any kind of symbol manipulation. In fact, an algebra is a set of symbols and a set of operations on those symbols.

When you define a structure with one or more instance fields, you are creating a set of symbols whose values are the union of all possible field values. When you define a set of functions/methods on that structure, you have created an algebra. You've just done math.

  • Have you worked with regular expressions? That's math. (Regular Languages)
  • Have you implemented a state machine? Yep, that's math. (Finite State Automatons)
  • Created a non-linear data structure -- a binary tree, for example? That's math, too. (Graphs)
  • Modeled data in an SQL database and ran some queries? Math. (Set Theory)
  • Used AND, OR, and NOT in an expression? Math, too. (Boolean Logic)
  • Written a recursive function? You get the idea...

Programming in all its infinite variety is math. As a programmer, I'd say I use some darn advanced math every day.

Barry Brown
A: 

By "math", do you mean heavy duty math ? If you code physical simulations (fluids, solids, whatever), you are not likely to code something working decently without a strong mastery of the maths behind, differential calculus and analysis are mandatory. Also, computational geometry is quite demanding in math skills. 3D development is so documented that you might avoid math by cut & pastes from examples... but don't expect to achieve something personal and well optimized without grasp on basic maths (trigonometry, linear algebra). By the way, those stuffs are my daily menu.

Monkey
+5  A: 

First about my background---I'm not quite a classic "software developer", though I've been writing software since the beginning of my professional career at age 17. I was a physics researcher for a number of years and now am an "analytic scientist" working creating predictive statistical models at a software company.

In the real world, unlike school, problems don't come to you on a plate decorated with a tag saying "This Is A Mathematics Problem."

The most profound breakthroughs arise when somebody who is familiar with the structure and capabilities of a number of fields of mathematics and science sees a problem---and a solution---in what might otherwise be a grotty and annoying, but straightforward, software problem. The right mathemetization---meaning usually "best effective approximation"---might represent a qualitative breakthrough.

Those moments are often rare, but they're critical. Somebody else could legitimately say "I've never had to use mathematics X,Y,Z ever in my programming career". And that's because they never saw the problem as an instance of a X or a Z or a something which they remember a long time back was something that A B and C study.

The most obvious and important example is in front of us every day. Why did Google search win? Remember Altavista, Hotbot, etc? At that time (pre 1998 or so) web search was all about data bases, keywords, etc. Classic programmer's programming.

Google won because Larry & Sergei and their thesis advisor recognized a mathematical problem inside the dreadful database crap: good web search meant solving---or approximating---an immense sparse eigenvector.

You didn't have to know all the different eigenvector algorithms---but you had to know what they were, and that there existed a large literature on solving them in various ways. Your creativity comes is mapping your current problem onto The Space of What is Known To Be Solvable In Some Way. That's how a scientific education helps.

For instance with an OK but no means extraordinary background I can understand well maybe 60% of the professional literature in CS, 50% of statistics, 35% of physics, etc. (actually professional mathematics is by far the hardest, I'd get less than 5%). Almost all of it will be useless for whatever I'm doing now---but every once in a while something may stick in my head, and pop up a long time later.

For instance, maybe that Bayesian mixture modeling those wacky professors used for text retrieval and vaguely heard about 5 years ago might turn out to be the cat's meow for something entirely different if you map "text" on to frobnozzes, words into flubars, et etc, and that can enable a fundamentally new solution, a new product, a new company or a new industry.

And the rest of the people may have gone on their way programming in the usual obvious brick-by-brick way.

And that is the real reason to know your mathematics---and science, and biology and statistics and engineering etc. It isn't just how much mathematics you need to do your job today, it's how much mathematics that you might be able to wield for your job tomorrow.