Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have less than 6 months to learn mathematics for my Master course in CS. (With no prior formal education in any computer/mathematics related area.) So I need to prepare my self to be tested on math as it relates to computer science.

As I found in Wikipedia, mathematics has many branches. Which ones are the most important for a programmer?

  • Arithmetic
  • Algebra (elementary, linear, multilinear, abstract)
  • Geometry (discrete, algebraic, differential)
  • Calculus/Analysis
  • Set theory
  • Logic
  • Category theory
  • Number theory
  • Combinatorics
  • Graph theory
  • Topology
  • Lie theory
  • Differential equations/Dynamical systems
  • Mathematical physics
  • Numerical analysis
  • Computation
  • Information theory
  • Probability
  • Statistics
  • Optimization
  • Control theory
  • Game theory

migration rejected from May 22 at 18:02

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

put on hold as off-topic by DeadMG, Blrfl, Ixrec, gnat, Adam Zuckerman May 22 at 18:02

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking career or education advice are off topic on Programmers. They are only meaningful to the asker and do not generate lasting value for the broader programming community. Furthermore, in most cases, any answer is going to be a subjective opinion that may not take into account all the nuances of a (your) particular circumstance." – DeadMG, Blrfl, Ixrec, gnat, Adam Zuckerman
If this question can be reworded to fit the rules in the help center, please edit the question.

@ChrisF I think those are different. This question is pretty specific -- the guy needs to pass an exam of some sort and wants to know what parts he should study. I don't think we're particularly capable of accurately answering that without knowing what the requirements are, but that's a different story. – Adam Apr 19 '11 at 21:06
@Anna - fair enough, they were just the first three that came up and were meant to be presented more for information than suggesting duplicates. Maybe I need to be clearer than just "see". – ChrisF Apr 19 '11 at 21:20
Since you have less than six months to prepare, you have to be very focused. Everything on your list is useful in some branch of computer science, but just getting an introduction to all of them would take years. Rather than ask people who don't even know what school you are going to attend, you should immediately contact your department and find out what they expect you to know. If they are like most departments they can even provide sample tests and suggested texts. – Charles E. Grant Apr 20 '11 at 8:06
possible duplicate of Where should I start learning math with regards to programming – Doc Brown Mar 20 '12 at 19:03

Personally I think math is good brain training, and I wouldn't really discourage any of these. But also I think some of these are particular to a given field, where it would be helpful to understand the math if you were programming for that field, but not for programming, in general.

Topics that are good in general for CS:

  • Abstract Algebra
  • Discrete Mathematics which generally includes:
    • set theory
    • logic
    • combinatorics
  • Graph theory
  • Control theory

For that, you'll need:

  • Arithmetic
  • Algebra (elementary)

For some UI work it's useful to know

  • Geometry (Algebraic geometry)
  • Game Theory - tells you a lot about ways humans may make decisions.

Many of the others are useful in particular fields but are not one size fits all in terms of usefulness.

Did you mean "I wouldn't really discourage..." ? – Chris Apr 19 '11 at 20:18
Yep. Sorry about that (apparently it's already been edited - thanks Tim!) – bethlakshmi Apr 20 '11 at 13:48
No worries, was going to edit but was not entirely sure of your intended direction. +1 after edits! – Chris Apr 20 '11 at 14:49

I recommend you review the prerequisites for the CS course you are going to take. They should give you a good idea of what you need to know.

As far as the CS program at my university you need to know:

  • Discrete Math
  • Calculus I/II
  • Linear Algebra
  • Physics
  • Probability and Statistics

And the prerequisites thereof. (mainly arithmetic, algebra, trigonometry)

I don't see why you need physics, linear algebra and calculus. Unless you are going into a proof heavy cs class and need 'mathematical maturity'. The absolute necessary prerequisites are probably discrete math and probability, the rest is just fluff to make your teacher's job easier. – davidk01 Apr 19 '11 at 21:41
@Davidk01- The OP said he needs to prepare himself in mathematics for a CS course. So he needs not just whats useful in practice, but theory as well. – P.Brian.Mackey Apr 19 '11 at 22:03
The OP also said he has only six months and absolutely no prior formal training in math/cs. The stuff you've listed takes a minimum of 2 years to learn. – davidk01 Apr 20 '11 at 0:25

To write non-mathematical software the amount of university level mathematics that you need is fairly minimal, to do a degree in CS, you probably want need CS style maths rather than maths maths; of the list you give:

  • Arithmetic [being able to do basic sums and solve basic equations is very useful; modular arithmetic is also very useful]
  • Algebra [linear algebra, things like simultaneous equations is useful, as are finding minima and maxima, but in general you would use a library for this, so just having an understanding of its existence is enough]
  • Geometry [basic euclidean geometry is useful because we live in the real world, everything else is a waste of time]
  • Calculus [again basic calculus is useful, but knowing how to do analysis is a total waste of time]
  • Set theory [the basics again are useful, knowing what a set is, an intersection, a union... but anything more advanced is a waste of time]
  • Logic [again understanding the basics like how to read and write and and or and not statements in compounds and how to manipulate those statements, not much else (knowing the proof to Goedel's third incompleteness theorem is useless)]
  • Category theory [totally useless]
  • Number theory [elementary number theory is useful, but again, just the basics]
  • Combinatorics [very useful, many real world problems are combinatorical - I think of combinatorics as "raw problem solving skills"]
  • Graph theory [quite useful - a lot of theoretical computer science problems are graph theoretical]
  • Topology [useless]
  • Lie theory [beyond useless]
  • Differential equations/Dynamical systems [basically a branch of calculus, quite specialist]
  • Mathematical physics [useful if you want to write a physics engine]
  • Numerical analysis [yep, a bit useful, but you don't need to know the theory, just how to apply it]
  • Computation [don't know what this is]
  • Information theory [snore, snore, snore - but for a CS degree pretty useful, it's a branch of probability and algebra]
  • Probability [useful]
  • Statistics [snore, snore, snore, but it is very useful]
  • Optimization [just a branch of calculus]
  • Control theory [?]
  • Game theory [might not be totally useless]

I'd say that if you have 6 months to prepare get this book for engineers and work through that. The real thing that you will get from doing mathematics is the problem solving skills.

This conversation has veered off track so I'm removing all my comments. My original point was about your classification of certain subjects as useless. I'm not here to discuss the merits and uses of categorical language. – davidk01 Apr 19 '11 at 22:07
Agreed, please feel free to edit the ones you think it is appropriate to, you seem to know a lot about the subject. – user23157 Apr 19 '11 at 22:15
So much prejudice in just one post! Abstract algebra is among the most useful things a programmer must comprehend - after all, all the code is made of algebraic constructs. Topology is useful for the very same reason. Category theory is at least somewhat useful - without it you'd reinvent monads over and over again. Number theory is a base for cryptography - everyone should know at least some bits of it. Set theory and logic are the most fundamental base for everything else - you can't avoid learning them. And I haven't seen an algorithmic information theory mentioned - it is a must. – SK-logic Apr 20 '11 at 12:59
"Category theory [totally useless]": Hm, it helps to describe certain software design patterns in a very succinct way and remove a lot of boilerplate from your code. I wouldn't classify it as "totally useless"! – Giorgio May 22 at 9:11

Analytics and/or Statistics

In my experience, I've found that a programmer who can understand a company's business analytics is far more valuable to an employer than a programming genius.

And like it or not, you'll probably be building reports for someone at one point or another in your career :)

But the question wasn't about career: it was about preparing for a degree course. – Peter Taylor Apr 19 '11 at 20:32

Concrete Mathematics: A Foundation for Computer Science would be my suggestion for a book that has a few branches of Mathematics to it wrapped within a CS core.

I'd also suggest looking into which textbooks does that class use and what parts of Math are used as there are numerous components where Math and CS intersect like Boolean Algebra, Big-O notation, Symbolic Computation, and Numerical Analysis to name just a few such areas.


I know that many computer science degrees require calculus, but from what I've heard, you can get by without it with other similar math courses. Friends with CS degrees have taken courses like Algebra (a requirement from pretty much ALL degrees), Statistics, Discrete Math (which is a huge requirement for CS majors), and Graph Theory.

Here are the requirements for a CS degree from the University of Texas @ El Paso. I cannot comment as to how their program compares to average CS programs, this just what came up on the ole' Google when searching for CS degree requirements:


Unless you are writing statistical software, physics software, graphics software, you probably don't need anything in your job beyond your normal school education. A company should try to have one guy who can solve a bit harder problems. That's 99% of all programming jobs handled just fine. For the last percent, that's specialisation. Most people will be better off learning more about software development.


As a game programmer/designer, I feel like almost all branches of math are relevant. I have used things as (seemingly) exotic as aerodynamics, stoichiometry, you name it!


Not the answer you're looking for? Browse other questions tagged or ask your own question.