0

I am currently pursuing a computer science degree & I am out of touch of most subjects in mathematics, even from secondary & high school. I wanted to know what subjects in mathematics would be absolutely necessary for computer science & it's prerequisite.

Do I have to do the entire algebra course (starting from Algebra basics) from Khan Academy?

I am really confused. I hope someone can help me out. Thanks

  • I personally would recommend linear algebra, computability theory and maybe category theory. I am not quite sure about the algebra course from Khan since it (1) might be taught at a high school level (?), and (2) it might be abstract algebra, which is not extremely necessary for computer science. – justadzr Jan 25 '20 at 12:59

1 Answers1

2

Since I'm a software engineer, I'll answer on the assumption you're more interested in practical applications than things like these (although that last one inspires some terminology relevant to my first bullet point below). At a minimum, you need to understand:

  • The idea of functions: in particular, you must be comfortable with functions as objects in their own right. A programmer expands the notion of "function" slightly, so it can do something rather than merely returning something. Comfort with functions is related to comfort with algebra. Functions in programming are basically written in algebra, except variables' names tend to be words or phrases, to make them easier to understand.
  • The difference between logarithmic, polynomial and exponential functions, how to differentiate and integrate them, and their relative growth rates. In particular, $\ln n\in o(n^\epsilon),\,n\in o(e^{\epsilon n})$ for any $\epsilon>0$. In algorithm design, you'll want to reduce time complexity, space complexity etc., although sometimes there's a trade-off. When you understand the colour-coded claims made here, and how to prove a few easy ones, and why they matter, you'll have what you need. As a simple example, the fact that binary search takes $O(\ln n)$ time, together with $\int\ln ndn=n\ln n-n+C$, tells us binary insertion sort takes $O(n\ln n)$ time.
  • There are $b-a+1$ integers from $a$ to $b$ inclusive. Do you know why the $+1$ is there? Good; you won't make these mistakes too often.

Depending on what you work in, you might also need to understand the mathematics in machine learning, numerical approximations, or 2D/3D graphics. A fair bit of calculus and linear algebra comes up from time to time (though which parts of it vary by subject), as can other things. For interview questions, however, that's what matters most. Category theory is also relevant to functional programming, but that's not for the faint of heart.

The CS theory Stack Exchange might give you more specific ideas than that, especially with lists such as this.

J.G.
  • 115,835
  • I use a little code sample to test the off by one error when interviewing. It is rather sad how many candidates with CS degrees and / or years of experience get it wrong. – badjohn Jan 25 '20 at 13:50
  • @badjohn I've interviewed enough candidates to have similar "sad they don't know X" insights. The lesson seems to be that interviews should test "atomic" parts of coding problems to see if people can get them right. – J.G. Jan 25 '20 at 13:52
  • The off by one error is the first of a set of tests that I use. Most are based on real mistakes that have led to bugs. Another tests knowledge of the precedence of and and or (sic). When the candidate fails these simple tests, I have to continue to pretend to consider them for a while to be polite but the decision has been made. – badjohn Jan 25 '20 at 14:07
  • That's a nice article. I have learned that no test is too easy as some candidates will still get it wrong. Heck, some even get $2 + 3 \times 4$ wrong. – badjohn Jan 25 '20 at 14:15