I've been wondering this for quite some time and decided to ask finally. What really is the role of math in computer science on higher levels like master's and PhD? Currently I am working on my BSc and hopefully get it done next summer. I have done like 5 math courses(linear algebra etc) + 5 statistics courses. I also did calculus in high school(integrals, derivatives etc) as I took the longer version of math which typically increases your chances to attend STEM programs here(EU country). Some of my professors have spoken how important they think math is in computer science, but is it really unless you go to some very specific fields like theoretic computer science? Because I haven't found it that useful outside of a few specific courses.

I am not sure whether I would like to pursue a PhD in the future but I've been leaning more towards it lately. Security research has gotten my interest and I've done some reverse engineering + vulnerability analysis and working on a small JIT assembler. Sadly not many undergrad courses teach these things so I've worked on them largely by myself. I haven't had any use for university level math on that, maybe I've just scratched the surface?

In some ways I feel bad for not taking more math courses and it's something that keeps annoying me but it's very hard to try to convince myself that some proofs about integrals are going to be useful in my future work/research. It would be nice if someone could elaborate what kind of role math plays in higher level of computer science studies. I have never honestly liked math that much but instead seen it as a something that you just need to know. What are some really useful math courses one should take?

  • 1
    Here is a link to the linear algebra behind Google's search engine. [rose-hulman.edu/~bryan/googleFinalVersionFixed.pdf]
    – David Hill
    Aug 12, 2015 at 23:43
  • 2
    This depends highly on which area of CS you are in.
    – Raphael
    Aug 13, 2015 at 7:22
  • I have a close friend doing a PhD in image processing. His day to day is VERY, VERY, VERY mathematical. He codes 3~5 state of the art mathematical algorithms every week. Aug 13, 2015 at 10:13
  • 5
    I’m voting to close this question as off-topic because it is about the contents of an academic discipline and not about academia itself. It may be on-topic on Computer Science.
    – Wrzlprmft
    Aug 13, 2015 at 10:56
  • 2
    @DavidRicherby On Computer Science, I think we'd close as "primarily opinion-based" or "too broad". A question of the form, "Do I need complex analysis for working on optimisations in the JIT?" would be okay, I guess. But really, this is something the OP should discuss with prospective advisors, not with strangers on the internet. Or, you know, just learn what you need to know on demand.
    – Raphael
    Aug 13, 2015 at 14:13

4 Answers 4


As Galileo has said, "[The universe] is written in the language of mathematics," and it is no different for computer science. To be a strong computer science researcher, you need to at least be fluent in the forms of mathematics that describe the work you wish to be engaged with.

Mathematics, however, is not a single thing, but a broad domain, and what you need to know will depend on what sort of research you are engaged with. For example, if you go into computer vision, you'll probably need to know a lot of complex geometry, whereas if you go into cryptography, you'll probably need really deep understanding of number theory. In some particular paths of work, you might in practice need very little mathematical knowledge at all.

What you absolutely must have, whether for computer science or for any other scientific pursuit, is a comfort with mathematical and scientific thinking in general, enough general mathematical fluency to acquire new expertise at need, and a solid working knowledge of statistics and data analysis to aid in interpreting experimental results. In almost all computer science work, you will also be greatly aided by fluency in algebra, general discrete maths, Boolean logic, and asymptotic complexity theory. Beyond that, it all depends on what you're doing.

  • 5
    +1 For What you absolutely must have, ... is a comfort with mathematical and scientific thinking in general.
    – Nobody
    Aug 13, 2015 at 3:07
  • +1. Jake, do you have any recommendations on one or several good books to refresh my math skills as well as to learn new material? The goal for this is to become more fluent in statistical and/or math methods, used in data science, computational social sciences, complex systems analysis, etc. I have some literature in mind, but wanted to hear your opinion/advice. I'd prefer comprehensive math books for scientists, if such exist, not textbooks or books, dedicated to a specific domain. Aug 13, 2015 at 3:07
  • +1. Finally somebody who doesn't blanket the subject with "you need to be good at mathematics in general" (which you don't), but properly qualifies with "...that describe the work you wish to be engaged with".
    – DevSolar
    Aug 13, 2015 at 9:58
  • 1
    @AleksandrBlekh - That's a lot to ask in a comment! --- Maybe what would work would be to ask a series of specific questions over at Mathematics Educators, and then include a link to the first one in a comment here. Aug 13, 2015 at 11:49
  • @aparente001: I understand your point. However, I prefer not to make big deal out of that question (at least, for now), as I simply expected to hear a couple of titles, if Jake (or anybody else, for that matter) already has them in mind. In the meantime, I will think about your suggestion about the ME site and appreciate your advice. Aug 13, 2015 at 12:33

Linear algebra is quite helpful, but you already took that.

I think by far the most useful courses you could take would be

graph theory

combinatorics and probability

Optionally, you could also take

stochastic methods

But there's a simple way to figure this out. Look at the program of study at a strong computer science PhD department. Pick out one or two areas of specialization that appeal to you, and see what math courses are required and suggested.


In the higher levels, especially the PhD, you are primarily working towards creating publications. Of course you will write software, but the idea expressed in your paper is your main result.

As a consequence, in most CS fields, the math is more important than either the software you write or the machine you run it on. A common quote is:

Computer Science is no more about computers than astronomy is about telescopes.

Ie. computer science is about the nature and possibilities of computation, not computers.

Of course, I don't mean to discourage you. I also didn't pay that much attention in the math classes in the early years. I'm now finishing a PhD in machine learning. I regret not paying more attention early on, but there is plenty of time in a master's and a PhD program to catch up. In fact, even the guys and girls who devoured the mathematics from day one will be faced with plenty of new material to digest once they hit their PhD. So long as you make a serious effort to work on it and really understand things deeply, you'll become comfortable with it in no time.

Finally, the type of math we use may be a little different from what you expect. I personally can't remember the last time I had to solve an integral, but I use probability theory, linear algebra, logic and combinatorics almost every day.


Let me add some of my own experience to the already excellent answer of jakebeal. If you go on to do anything with machine learning or predictive modelling, you will need the statistics. For bioinformatics but also more in general when modelling some multivariate system, you will need the linear algebra. For scientific programming, for modelling real world systems, you will need differential equations and understanding of complex systems.

Not the answer you're looking for? Browse other questions tagged .