## Math and Computer Science

I have seen some people posting on the Internet claiming that as professional programmers, they never had to use any advanced math; many of them actually didn't even graduate from college and claim that it hasn't affected them at all.

I majored in applied mathematics and computer science in college, and I must say that having a mathematics background immensely helps in being able to produce sophisticated programs.

I was looking over the latest issue of ACM's (Association of Computing Machinery) magazine and the lead article was discussing why CS students should study math. The article lays an interesting set of arguments for learning math.

Here are the articles:

Why math? -- My favorite

Why Universities require CS students to take math?

Mathematical Reasoning in Software Engineering Education

What is the attraction toward computing?

The examples the article refers to include dynamic resizing of arrays (why doubling an array is much preferable to fixed increments) and understanding the complexity of a problem. Dynamic array sizing is such a classic example.

Mathematically illiterate programmers tend to write highly optimized O(n^2) functions, that perform very quickly for small-sized problems, but become increasingly slow for large problems. Knowledge of arcane tricks to shave cycles lead these programmers to delude themselves of their apparent skill. What really happens is that code becomes more obfuscated and unmaintenable and that code executes much more slowly when its execution time becomes more noticeable to user, that is, when inputs become large. Small inputs proceed so quickly in milliseconds, that, even with a ten-fold difference in the constant factor, the optimized, low-constant quadratic-order code might not be perceptibly different to the user than the high-constant but algorithmically superior approach. These programmers are limited by their skillset to writing nonscalable small-time applications.

If you wanted to do game development, you need to learn linear algebra; physics also helps. AI and natural language processing is heavy on statistics, logic, and graph theory. I found theory of computation, which I initially thought to be abstract and purely academic with its study of DFAs and CFGs, to be very practical in my work with natural language processing.