# How does one become great at computer science mathematics?

This question is bothering me since I started using Stack Exchange. I just want to share examples of people that made me surprised.

https://crypto.stackexchange.com/questions/100450/how-to-prove-that-crc-with-an-initial-value-of-zero-is-linear

https://crypto.stackexchange.com/questions/98009/could-this-be-a-secure-multiparty-secret-sharing-scheme

https://crypto.stackexchange.com/questions/99875/can-there-be-identical-elliptic-curve-groups-of-points-from-different-irreducibl

I am talking about the users who are doing the math in answers. It is not joke math, it is serious math that is too tough for me to understand.

I am undergraduate student who is graduated from college. But we never had to do such theoretical questions in college. It was mostly numbers based instead of formulas based. And we didn't learn to do such proofs even though we did study theory of computation. We didn't have to prove a lot of dangerous looking things in that subject as well. Instead it was included for few marks and we were supposed to write the gist of that (rather than proving them).

We did discrete mathematics as well and we never had to study about such stuff. It was about graph theory and stuff, and our exams never tested us on deriving something, nor did the teacher's slides focus on it.

But this is really making me hurt that I don't know what almost everyone knows in CS.

Almost all posts of Yuval Filmus in cs.stackexchange.com surprises me. He has an unimaginable amount of knowledge and can prove anything and everything. How can one become near to that level of rigour? Honestly, this surprises me thus I am asking. I studied computer engineering in college which is a mixture of CS and electronics/communication engineering.

• "Mathematics not make one great." (paraphrase) Jun 7 at 10:21
• As Jared says. "almost everyone" is entirely wrong. A very small cadre of highly specialised people know this stuff, it's greek to the rest of us. The kind of deep number-theory and mathematical material you're looking at is a whole branch of mathematics and computer-science that most people never learn. I don't know it, and I'm a software dev who's been working professionally for a decade! Jun 7 at 12:22
• I just want to point out that Yuval Filmus, assuming this is his real name, is an Associate Professor at Technion, a school well-known for theoretical CS (yuvalfilmus.cs.technion.ac.il). The answer to "How do I get that good at theoretical CS?" is "study it for all your adult life and also have a lot of innate talent". If you expected that your undergrad degree in a related field would you bring you anywhere close to that level of knowledge, you had too high expectations ;) Jun 7 at 13:10
• All those examples are from cryptography stack exchange. Cryptography is a branch of computer science which is literally all about coming up with and analyzing complicated math problems. The stuff cryptography experts deal with on a daily basis is far more math-heavy than in any other branch of CS. Most of what they talk about is black magic to most computer scientists with other specializations. Stackoverflow and even Security SE are so scared of them, they exiled them to their own site :) Jun 7 at 13:43
• @Philipp And most employers will not find this level of mathematics useful, applicable, or even comprehensible. As important as cryptography is, significant portion of the CS workforce don't have to do mathematics at this level, so almost no employers will expect this unless you're specifically hired to to cryptography. Jun 8 at 4:16

What makes you think that "almost everyone" knows things like elliptic curves (your 3rd link)? That is pretty advanced math. In fact, it was developed by mathematicians who may not have been programmers at all. Don't feel bad that with only undergraduate knowledge you haven't mastered all of this.

Computers were developed for doing computations. Rocket trajectories and such. Those computations come from physics, and as such have been studied long before there were electronic computers. So a good part of computer science consists of other sciences (graph theory, partial differential equation solving, cryptography) that happen to suit being done on a computer. To know all of this you'd need to study all those other sciences.

• Programming definitely got off to a bad start with all that WW2 codebreaking stuff. But then, many new technologies were initially developed as munitions. Jun 7 at 10:39
• @ScottRowe Codebreaking is a "bad start"? It likely shortened the war considerably. Are you saying things would be better if WWII had been a bit longer? Jun 7 at 11:06
• @ScottRowe I'm not sure that code breaking was the main application that computers were intended for. Look up what ENIAC stands for. Likewise, what motivated Babbage? Zuse seems to have had aerodynamics as application in mind. Jun 7 at 13:34
• Well, you mentioned rocket trajectories, and the first rockets were in WW2, as best I recall. And who wanted those tables of logarithms done, long before computers existed? Some General I think... Who was that guy who broke Enigma? Computer theorist, I think. Jun 7 at 20:15
• @ScottRowe ...I don't know whether or not you mean Turing by 'the guy who broke Enigma' or the Polish mathematicians whose work was fundamental to breaking Enigma (see here; like much work it's more complicated than one person doing it solo)? If you do mean Turing, please read about him; he had a tragically short life but was incredibly brilliant. Jun 8 at 4:13

Computer science emerged out of a branch of mathematics, and many of the sub-branches of modern computer science also emerged from branches of mathematics. That means that there are deep, pervasive links between the two fields, and you don't have to dig too far to find them.

However, it is usually unnecessary to be fluent in the parent mathematical field in order to be an excellent practitioner of the child CS field.

The reason that your undergraduate program didn't cover the mathematics so deeply is because the deeper mathematics mostly doesn't help you to engineer, produce, or code better, and what gains there are falter in the face of a simple cost-benefit analysis. It takes a lot of effort and time to become a Yuval Filmus, who is, after all, a mathematician, and the benefits to coding and engineering are quite small relative to that effort.

If your goal is engineering, then, your efforts are better spent elsewhere.

Now that my answer is done, I will also dispense some advice:

• If you are fascinated by the mathematics, then that is a reward in and of itself, and the meager gains in engineering will be well worth it because, given the expense of learning the mathematics, few of your peers will be able to do the handful of new things that you can now do. Therefore, if you are interested in the mathematics for the sake of the mathematics and interest, absolutely pursue it. You'll gain good rewards, both in life and in engineering.

• However, if you are interested in the mathematics mostly for the gains you'll get as an engineer, I would not advise you to head far in that direction. You will find it a very difficult hill to climb. It won't feel especially rewarding, it will feel especially hard, and the engineering rewards will be few and far between.

• So people like yuval filmus are with math degree and minor in cs or sth like that right? Jun 6 at 14:13
• @kudmea I mean, according to his resume (linked from his homepage), it appears that his degrees are in CS. However, he's clearly a mathematician at heart. You can see that in his posts, his research interests, and his publications :)
– Ben I.
Jun 6 at 14:43
• I will always yearn for a world where programming had emerged from electronics and engineering instead of mathematics. sigh Jun 7 at 10:28
• @kudmea Maybe. Or they may just have a degree in CS and have spent a lot of time involved with the math side of things. Or they may even have a completely unrelated degree. It’s not so much important what degree you have, especially if it’s just an undergraduate degree, what matters is what experience you have and what you do with it. I have no formal degree myself and can argue about graph theory or set theory as they apply to coding just as well as my co-workers who have CS related degrees despite this. Jun 7 at 12:40
• Actually @ScottRowe you can find competing histories - CS = math. And CS = machine engineering. See m-cacm.acm.org/magazines/2014/1/… for a contra mainstream view
– Rusi
Jun 7 at 16:25

What you have discovered is that there is a vast difference between math and CS. Each of those fields can in some ways apply the other for some things but the thinking process is quite different.

The math you need for things like cryptography is quite advanced and depends on a deep knowledge of other things.

If you want to learn mathematics, then you need to study mathematics. The sorts of things you study from math in an undergraduate CS program is a tiny fraction of math as a whole. Discrete math is important to a lot of CS so it is normally studied. But number theory is pretty esoteric and requires its own insights. Insight in math isn't easily transferred from one subfield to another.

Crypto isn't my field (or interest) so I can't provide specific guidance, but if I wanted to study it, I'd find a good book and see whether I could understand it or had to go back to basics.

I'd also look at the requirements of a good cryptography course at a good university and look at what prerequisites are needed.

The Duke University course has many prerequisites including multivariate calculus, linear algebra and differential equations. I'm guessing that your undergrad CS program didn't include much of that.

Note also that crypto stands on the cusp between math and CS and requires applications of both fields. It is an applied field with theoretical underpinnings. If you studied a rather different applied math field (engineering) then they might be lots of gaps.

Get studying.

• ioenotes.edu.np/ioe-bct-syllabus (look up to first 4 semesters engineering mathematics) They taught us all math indeed, 4 engineering mathematics that are taught to every engineering branches. But our math was based on solving problems rather than deriving, proving etc. Jun 6 at 13:41
• I dont think Calculus is relevant. My choices of areas would be: (a) Abstract algebra (group theory going on to rings and fields) (b) Basic number theory (modular arithmetic) (c) Combinatorics (d) Linear algebra. See reddit.com/r/crypto/comments/cdgfp2/…
– Rusi
Jun 6 at 13:44
• @Rusi, I just listed the requirements for the course at Duke. They include a lot of multivariate calculus. I was a bit surprised myself. Jun 6 at 13:46
• Yes @kudmea engineering math -- solving problems -- and higher math -- proving results -- is fundamentally different like Horowitz and Art Tatum. I would not put one above the other (the "higher" notwithstanding). But one does not do much for the other
– Rusi
Jun 6 at 13:46
• Yeah I know Buffy. And I never miss the opportunity to point out that calculus is as likely relevant to most things math as arcane assembly tricks is to programming 😉 Its there for hoaryness not relevance reasons. I enjoyed it when I studied math. But that does not change the fact that it takes up way too much room in the curriculum. Main point (for OP) is that UG calculus is just tricks for solving problems and misleads students to what math is on a broader perspective.. Real and complex analysis which is just 2nd level calculus may be better for that
– Rusi
Jun 6 at 13:50

There is math and math and ... and math. [See Map of Math]. Its very important to not get sidetracked by getting dazzled!

Just as there is music and music ... and music.

Let's look a little deeper at the music analogy.

Its not often that devotees of one form will be drawn (much) to the others.

More important:

Practice of one form will not conduce to (much) development on the other sides

Yeah...Yeah. There are famous exceptions like Ravi Shankar collaborating with Yehudi Menuhin. But these are exceptions!

Two points I'd like to leave you with:

• 99.9% of those who are inspired to play an instrument by looking at someone like Horowitz will not even nearly approximate Horowitz

• 95% of those who do try (assuming the attempt is not a trivial 1 month attempt) will go on to become better than they were before.
See this compressed progress story

So just as in music there is no alternative but to practice, math is likewise. Take the area you want to be good at...

And work at it!

PS. Yuval Filmus usually writes at CS-SE.
All your examples are from Crypto-SE. Notice? They are different!

PPS. If Yuval Filmus is your idol you should ask Yuval Filmus! Maybe on CS-SE... Maybe on meta-CS-SE

This YouTube video seems like a nifty taste of the difference between CS-math & math-math.

• "Math and math! What is math??!?" (paraphrase) Jun 7 at 10:26
• Not sure what you're asking @ScottRowe. In any case I added a first line. Not mathematically very astute but ok as a conspectus
– Rusi
Jun 7 at 11:06
• Ok, you can find a video clip by searching for "Brain and brain! What is brain?" It's cute. Anyway it is like the old joke where a musician asks a cab driver how to get to Carnegie Hall. The cab driver says "Practice!" Jun 9 at 10:12

As others have pointed out, you shouldn't really feel bad about not knowing these things; you say you have studied computer engineering rather than computer science, and there seems to be, in many places, a distinction between 'engineering' and 'science' in that the engineers learn how to do things - the formulas, algorithms etc - whereas the scientists learn why you should use certain formulas and algorithms. And that leaves us with a lot of computer engineers who feel frustrated that they don't understand theory better (as well as a number of computer scientists who couldn't string a piece of code together if their lives depended on it).

You should see your frustration as a good thing - it makes you want to learn more. The process of learning can be deeply rewarding in itself and on top of that, there are many indications that continuing to learn all your life may be an important factor in avoiding dementia in later life.

• Right, "Use it or lose it" Jun 9 at 10:15

You are asking two related questions:

• Does college prepare one to answer random questions on Cryptography?
• How does one get better at answering such questions?

We never had to do such theoretical questions in college. We didn't learn to do such proofs. Our exams never tested us on deriving something.

The only conclusion is that your college education didn't focus on theorem proving; it had different aims, presumably preparing you for the job market.

Is this typical? Are you lacking knowledge which is commonplace in CS, to paraphrase your penultimate paragraph? Let's break this down to two questions:

1. Do CS programs usually aim at imparting theorem proving skills?
2. Are CS programs which aim at imparting such skills successful in imparting them?

The answer to the first question depends on the type of the program: the country, the type of academic institution, and so on. In Israel, traditionally CS programs are highly theoretical, whereas in the US, only half the degree is focused on the major, and the mathematical level is dramatically lower (proof-based math classes, which our undergraduates start taking during their very first semester, are delayed until the third year in the US).

The answer to the second question depends on many factors, include student motivation. According to my experience, the typical student can write a proof (they have to, in order to pass some of the more theoretical classes), but they don't have a deep understanding of the material, and so won't be able to answer random questions on Cryptography.

Indeed, people who are answering such questions are mostly (though not exclusively) experts on the topic, who have spent many years honing the relevant skills. It's not fair to compare yourself, a college graduate, to someone who is doing their PhD, let alone someone who is faculty. You simply have less experience than these folks. Moreover, people doing their PhD are more naturally inclined toward mathematical thinking (that's why they chose to do a PhD in such a topic), and so they are (much) better than average; all the more so for faculty.

Finally, how do you get better? Study, Practice, and Talent (a complex combination of nature and nurture). But first, you need to have realistic expectations so you don't get discourage. Don't expect to be at the level of a world expert right away. You get better with time. Studying in a structured setting and collaborating with peers and more senior experts is a great help. Research is a lifelong endeavor, and we are constantly learning and improving. This is a big topic which really merits its own separate discussion.

• This is the first time I've seen a question directly about a stack exchange user, and now it is answered by that user. Nice! I hope you got a kick out of it 😂
– Ben I.
Jun 14 at 21:44

But this is really making me hurt that i don't know what almost everyone knows in cs.

Why?

This is the most important question... why is that? What does it matter?

There is a much more philosophical question at the heart of this post that I think you need to address. For example, what is "joke math"? What is serious math? Your version of serious math to me is joke math to me, and my version of serious math is joke math to a MSc/PhD. For this reason, I don't think it's worth talking about because it's too subjective and ill-defined. This becomes a fruitless endeavor because every time you get better, your window will shift, and it's a never ending chase that you don't resolve if your intention is to "become good at math".

Ask yourself another question, suppose you got all this information in the span of a second, then what? I suspect you would feel happy for a brief period and be back to the same empty void that is making you "really hurt".

I disagree with people telling you to study math here, I think you should do that after you have spent time figuring out, deeply, why you feel this way, and whether it is a phantom of inadequacy or not. Only then can you decide for yourself whether pursuing mathematics more formally is something you should consider. Life is unbelievably short, make your time worth it.

• +1 from me. However this is the wellknown philosophy problem called Meno's paradox faculty.washington.edu/smcohen/320/menopar.htm
– Rusi
Jun 7 at 5:12
• Personally, I value math and research(not that practical things are not great) that is why I was mesmerized. But I looked at yuval filmus's biography, he is multiple degree holder and has a PhD. That explains. And I have always felt I have lacked in cs related math compared to conventional one, so I wanted to fix this. Jun 9 at 3:32
• CS related math is a worthy goal @kudmea! And in most schools badly addressed. Your question strongly suggests crypto related math — similar but different. You should edit it accordingly. Just one more note. When I was a student theory & research were v close. Nowadays research almost means opposite of theory. Bar and gantt charts and little content
– Rusi
Jun 9 at 5:02
• @kudmea Keep in mind that some people start their 'work' (what they become known for) fairly late in life. There is a famous photographer who first picked up a camera at age 70, as I recall. (Now you can't help but pick up a camera at age 2, but you get the point.) Jun 9 at 10:03

If by mathematics you mean exactly that, mathematics, not including logic or even if you mean the kind of mathematics used in cryptography, then I don't have much to add.

However, if you mean a mathematical approach to computer science or programming then have a look at the following keywords: formal methods, formal verification, model checking, SMT solvers, Event-B, Hoare-Floyd logic, the Z formal notation, the Coq proof assistant, Isabelle/HOL, Temporal Logic of Actions (TLA), Communicating Sequential Processes (CSP), $$\pi$$-calculus, linear time temporal logic (LTL), type theory, category theory, relation algebra, and a very long etcetera.

All that is mathematics for computer science. Most of those topics has nothing to do with traditional math such as calculus, linear algebra, geometry, continuous functions, integrals, derivatives, etc.

"Ben I" said in an answer above:

The reason that your undergraduate program didn't cover the mathematics so deeply is because the deeper mathematics mostly doesn't help you to engineer, produce, or code better, and what gains there are falter in the face of a simple cost-benefit analysis.

In my opinion this is not right. There's a body of mathematics and logic that is tantamount to your value as a software developer. Unfortunately, most CS curricula don't tech that or does it in optional courses, while forcing you to take courses on mathematics which will not help you to maximize your programming/CS skills.

• My "mostly" was an important hedge :) In truth, I expect that the large majority of programmers never use (at least in any way that they are aware of) even a bit of what you've outlined. It's easy to demonstrate that, too. Go to 10 random programmers and ask them which of those topics they feel that they know well. That's what I mean about the diminishing returns: you can study a LOT and still gain very little "practical" in your day-to-day. (FWIW, I support learning regardless, but I am perhaps more sympathetic than you are to degree programs that choose to deemphasize mathematics.)
– Ben I.
Jun 15 at 21:35
• It's difficult to state, because if you know something that really solves a problem, it justifies a lot of time spent learning many other things. You never know what specific things will turn out essential in the future. Jun 25 at 0:26