What are the core mathematical concepts a good developer should know?

AlgorithmMathLanguage Agnostic

Algorithm Problem Overview


Since Graduating from a very small school in 2006 with a badly shaped & outdated program (I'm a foreigner & didn't know any better school at the time) I've come to realize that I missed a lot of basic concepts from a mathematical & software perspective that are mostly the foundations of other higher concepts.

I.e. I tried to listen/watch the open courseware from MIT on Introduction to Algorithms but quickly realized I was missing several mathematical concepts to better understand the course.

So what are the core mathematical concepts a good software engineer should know? And what are the possible books/sites you will recommend me?

Algorithm Solutions


Solution 1 - Algorithm

Math for Programmers. A good read.

Solution 2 - Algorithm

Boolean algebra is fundamental to understanding control structures and refactoring. For example, I've seen many bugs caused by programmers who didn't know (or couldn't use) deMorgan's law. As another example, how many programmers immediately recognize that

if (condition-1) {
    if (condition-2) {
        action-1
    } else {
        action-2
} else {
    action-2
}

can be rewritten as

if (condition-1 and condition-2) {
    action-1
} else {
    action-2
}

Discrete mathematics and combinatorics are tremendously helpful in understanding the performance of various algorithms and data structures.

As mentioned by Baltimark, mathematical induction is very useful in reasoning about loops and recursion.

Set theory is the basis of relational databases and SQL.

By way of analogy, let me point out that carpenters routinely use a variety of rule-of-thumb techniques in constructing things like roofs and stairs. However, a knowledge of geometry allows you to solve problems for which you don't have a "canned" rule of thumb. It's like learning to read via phonetics versus sight-recognition of a basic vocabulary. 90+% of the time there's not much difference. But when you run into an unfamiliar situation, it's VERY nice to have the tools to work out the solution yourself.

Finally, the rigor/precision required by mathematics is very useful preparation for programming, regardless of specific technique. Again, many of the bugs in programming (or even specifications) that I've seen in my career have sloppy thinking at their root cause.

Solution 3 - Algorithm

I would go with the fields that Landon stated:

> Discrete Math, Linear Algebra, > Combinatorics, Probability and > Statistics, Graph Theory

and add mathematical logic.

This would give you a grip on most fields of CS. If you want to go into special fields, you have to dive into some areas especially:

Computer graphics -> Linear Algebra
Gaming -> Linear Algebra, Physics
Computer Linguistics -> Statistics, Graph Theory
AI -> Statistics, Stochastics, Logic, Graph Theory

Solution 4 - Algorithm

In order of importance:

  • Counting (needed for loops)
  • Addition, subtraction, multiplication, division.
  • Algebra (only really required to understand the use of variables).
  • Boolean algebra, boolean logic and binary.
  • Exponents and logarithms (i.e. understand O(n) notation).

Anything more advanced than that is usually algorithm-specific or domain-specific. Depending on which areas you are interested in, the following may also be relevant:

  • Linear algebra and trigonometry (3D visualization)
  • Discrete mathematics and set theory (database design, algorithm design, compiler design).
  • Statistics (well, for statistical and/or scientific/economic applications. possibly also useful for algorithm design).
  • Physics (for simulations).

Understanding functions is also useful (don't remember what the mathematical term is for that area), but if you know how to program you probably already do.

My point being: A ten year old should know enough mathematics to be able to understand programming. There isn't really much math required for the basic understanding of things. It's all about the logic, really.

Solution 5 - Algorithm

"Proof by induction" is a core mathematical concept for programmers to know.

Solution 6 - Algorithm

Big O notation in general algorithm analysis, and in relation to standard collections (sorting, retrieval insertion and deletion)

Solution 7 - Algorithm

For discrete math, here is an awesome set of 20 lectures from Arsdigita University. Each is about an hour and twenty minutes long.

Solution 8 - Algorithm

Start with what we CS folks call "discrete math". Calculus and linear algebra can come in quite handy too because they get your foot in the door to a lot of application domains. Once you've mastered those three, go for probability theory. Those 4 will get you to competency in 95% (I made that up) of application domains.

Solution 9 - Algorithm

Concrete Mathematics covers most of the major topics. A good book on Discrete Math, like Rosen's Discrete Mathematics and Its Applications, will fill in any gaps.

Solution 10 - Algorithm

I think it depends on your focus. A few years ago I purchased the set of Art of Computer Programming by Donald Knuth. After looking at the books I realized pretty much everything is calculus proofs. If you're interested in developing your own generic algorithms and proofs for them, then I recommend being able to understand the above books since its what you'd be dealing with in that world. On the other hand if you only want/need to use various sorting/searching/tree/etc... routines then big O notation at a minimum, boolean math, and general algebra will be fine. If you're dealing with 3D then geometry and trig as well.

I tend to be more on the using side than making proofs, and while I'd like to think I've done some clever things over the years I've never sat down and developed a new sorting routine. The best advice I can give is learn what you need for your field, but expose yourself to higher levels so you know it exists and how much more there is to learn, you won't get much growth otherwise.

Solution 11 - Algorithm

I would say boolean logic. AND, OR, XOR, NOT. I found as programmer we use this more often than the rest of math concepts.

Solution 12 - Algorithm

Basic Algebra and Statistics are good starting points, and the foundation for a lot of other fields.

Solution 13 - Algorithm

Here is a simple one that baffles me when I see developers that don't understand it:

  • Order of Operations

Solution 14 - Algorithm

Chapter 1 of "The Art of Computer Programming" aims to provide exactly this.

Solution 15 - Algorithm

There was a book that was recommended...the title was something like Concrete Mathematics. It was recommended in a few questions.

Solution 16 - Algorithm

Back in school, on of my instructors said for business applications, all you need to know know add, subtract, multiply, and divide. All other formulas the requester will know and inform you what is needed. Now realize that this is for financing reporting and application focused school. To this day, this has held true for me. I have never once needed to know more than that.

Solution 17 - Algorithm

Check the book http://infolab.stanford.edu/~ullman/focs.html">Foundations of Computer Science
This book is authored by: Al Aho and Jeff Ullman and the entire book is available online.

This is what the authors say in their Preface about the goal of this book:

"Foundations of Computer Science covers subjects that are often found split
between a discrete mathematics course and a sophomore-level sequence in computer
science in data structures. It has been our intention to select the mathematical
foundations with an eye toward what the computer user really needs, rather than
what a mathematician might choose."

Solution 18 - Algorithm

a site for brushing up on Math: http://www.khanacademy.org/

Solution 19 - Algorithm

My math background is really poor (Geologist by training), but I took a discrete math class in high school and I use the concepts every day as a programmer. It is probably the most valuable class I took in all of my education as it relates to my current profession.

Solution 20 - Algorithm

Discrete Math
Linear Algebra
Combinatorics
Probability and Statistics
Graph Theory

Solution 21 - Algorithm

  • Boolean Algebra
  • Set Theory
  • Discrete Math

Solution 22 - Algorithm

Well, that depends on what you goal is. As someone said, Linear Algebra, Combinatorics, Probability and Statistics and Graph Theory are important if you're into solving hard problems. Asymptotic growth of functions (bit-Oh notation) is very important. You will also need to master summations and series if you need to work on analyzing some more complex algorithms (see the appendix on Cormen&others Intro to Algorithms).

Even if you're into "Java for the enterprise" or "server-side PHP", you will find some Statistics and Algorithm Complexity (hence combinatorics, induction, summations, series, etc) useful when your boss wants you to get the server to work faster, and adding new hardware doesn't seem to help. :-) I've been through that once.

Solution 23 - Algorithm

  • Boolean Algebra
  • Set Theory

Solution 24 - Algorithm

Why is everybody including probability and statistics in the gold list without mentioning calculus? One cannot understand what probability and statistics are about without at least a working knowledge of limits, derivatives, integrals and series. And all in all, calculus (together with linear algebra) is the workhorse of all mathematics.

Solution 25 - Algorithm

I think algorithms and theory are of great importance. Being able to come up with a fast, and correct solution is what differentiates good programmers from the rest. Also, being able to prove your algorithm (using standard proof techniques-- induction, contradiction, etc) is equally important.

Solution 26 - Algorithm

Yeah, I would say a basic understanding of induction helps so that you understand what n represents in algorithms. Also some Logic and Discrete Structures is helpful.

Solution 27 - Algorithm

Probability and Statistics are very helpful if you ever have to do anything resembling machine learning.

I cover the basics in my "Computing Your Skill" blog post where I discuss how Xbox Live's TrueSkill ranking and matchmaking algorithm works.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJose B.View Question on Stackoverflow
Solution 1 - AlgorithmGulzar NazimView Answer on Stackoverflow
Solution 2 - Algorithmjoel.neelyView Answer on Stackoverflow
Solution 3 - AlgorithmRalph M. RickenbachView Answer on Stackoverflow
Solution 4 - AlgorithmAnders SandvigView Answer on Stackoverflow
Solution 5 - AlgorithmBaltimarkView Answer on Stackoverflow
Solution 6 - AlgorithmCorin BlaikieView Answer on Stackoverflow
Solution 7 - AlgorithmCoreyView Answer on Stackoverflow
Solution 8 - AlgorithmBen CollinsView Answer on Stackoverflow
Solution 9 - AlgorithmBill the LizardView Answer on Stackoverflow
Solution 10 - AlgorithmddownsView Answer on Stackoverflow
Solution 11 - AlgorithmJimmy ChandraView Answer on Stackoverflow
Solution 12 - AlgorithmJosephStyonsView Answer on Stackoverflow
Solution 13 - AlgorithmDaniel AugerView Answer on Stackoverflow
Solution 14 - AlgorithmMichael DorfmanView Answer on Stackoverflow
Solution 15 - AlgorithmThomas OwensView Answer on Stackoverflow
Solution 16 - AlgorithmMike WillsView Answer on Stackoverflow
Solution 17 - AlgorithmsateeshView Answer on Stackoverflow
Solution 18 - AlgorithmfunctorView Answer on Stackoverflow
Solution 19 - AlgorithmJasonSView Answer on Stackoverflow
Solution 20 - AlgorithmLandonView Answer on Stackoverflow
Solution 21 - AlgorithmmrbradleytView Answer on Stackoverflow
Solution 22 - Algorithmsergio_petraliaView Answer on Stackoverflow
Solution 23 - AlgorithmFortyrunnerView Answer on Stackoverflow
Solution 24 - AlgorithmFederico A. RamponiView Answer on Stackoverflow
Solution 25 - AlgorithmScott WegnerView Answer on Stackoverflow
Solution 26 - AlgorithmAaron Mc AdamView Answer on Stackoverflow
Solution 27 - AlgorithmJeff MoserView Answer on Stackoverflow