Live data from Hacker News

Math topics useful for computer science/programming

matheducators.stackexchange.com

11–20 of 69 posts

Re: Math topics useful for computer science/programming

#11
post #5

"Many students struggle with the idea of recursion..." I still remember one of the worst bugs I'd ever introduced (in terms of pain to me). I was maybe 2-3 years out of my bachelors, and I thought recursion was so nifty that I'd use it where ever I could. I was coding C++, at the time. And, I got the dreaded 2am call after all of the production servers went down hard. Like terminate and corrupt data hard. Lesson lear…

What problem were you trying to solve with recursion?

Re: Math topics useful for computer science/programming

#12
I'd include combinatorics under 'useful' too - although the basics are usually covered in statistics courses. Odd that the list mentions differential equations but not basic calculus, which I'd think is more fundamental.

It's also interesting to consider the chapter headings in Concrete Mathematics (Graham, Knuth, Patashnik), a text designed with students of CS and programming in mind:

    Recurrent Problems
    Summation
    Integer Functions
    Number Theory
    Binomial Coefficients
    Special Numbers
    Generating Functions
    Discrete Probability
    Asymptotics

Re: Math topics useful for computer science/programming

#13
post #5

"Many students struggle with the idea of recursion..." I still remember one of the worst bugs I'd ever introduced (in terms of pain to me). I was maybe 2-3 years out of my bachelors, and I thought recursion was so nifty that I'd use it where ever I could. I was coding C++, at the time. And, I got the dreaded 2am call after all of the production servers went down hard. Like terminate and corrupt data hard. Lesson lear…

That and tail-call optimisation :)

Re: Math topics useful for computer science/programming

#15
post #12

I'd include combinatorics under 'useful' too - although the basics are usually covered in statistics courses. Odd that the list mentions differential equations but not basic calculus, which I'd think is more fundamental. It's also interesting to consider the chapter headings in Concrete Mathematics (Graham, Knuth, Patashnik), a text designed with students of CS and programming in mind: Recurrent Problems Summation In…

I got Concrete Mathematics a few days ago, after someone recommended it. My background is physics, and I find the "mathematicians' style" to be very awkward to learn from. This book is excellent for me - concrete examples - it is always trying to solve specific problems, so if I don't follow the theory, I can always refer to a concrete example and try to understand that specific case. This the way I learn best/fastest.

Re: Math topics useful for computer science/programming

#16
post #3

This does not seem very informed, starting from the false premise in the question up to the random concepts listed in the answers. Calculus is actually important for Computer Science, it's actually important for everything, it's where you learn how to handle the exponential function and the natural logarithm, how to do approximations and bounds, how to handle infinite series, etc., and those things then appear all ov…

> Calculus is actually important for Computer Science, it's actually important for everything, it's where you learn how to handle the exponential function and the natural logarithm, how to do approximations and bounds, how to handle infinite series, etc., and those things then appear all over the place, It's still interesting to think about which branches of math are actually applicable to programming itself. People…

I have a couple simple ones off the top of my head:

- You write a recursive program the same way you write an inductive proof

- Abstract algebra and category theory are likely relevant, especially for metaprogramming. My math education hasn't included this, so I can't say much more.

- Linear algebra is just ridiculously important

- Statistics for machine learning. Also for figuring out how to combine data in a meaningful way. There are also a lot of people asking statistical questions directly, and writing programs is how you get those kinds of answers in a reasonable timeframe.

Re: Math topics useful for computer science/programming

#17
post #3

This does not seem very informed, starting from the false premise in the question up to the random concepts listed in the answers. Calculus is actually important for Computer Science, it's actually important for everything, it's where you learn how to handle the exponential function and the natural logarithm, how to do approximations and bounds, how to handle infinite series, etc., and those things then appear all ov…

> Calculus is actually important for Computer Science, it's actually important for everything, it's where you learn how to handle the exponential function and the natural logarithm, how to do approximations and bounds, how to handle infinite series, etc., and those things then appear all over the place, It's still interesting to think about which branches of math are actually applicable to programming itself. People…

Another example:

- Linear algebra used in graphics and game programming

Re: Math topics useful for computer science/programming

#18
Although I did mathematics to degree level, I have used so little of it in my professional career that I have largely forgotten it all now. Any such list is going to depend on what area of programming you want to get into.

For a lot of programming understanding user interaction and human psychology is much more important than mathematics.

Re: Math topics useful for computer science/programming

#19
post #2

I never liked these kinds of lists. The people who ask the question always seem to be under- or overwhelmed by the answer (programmers don't need any math?! theoretical computer scientists need all math?!). And the people who answer are almost always skewed toward whatever it is they do. Even the top-voted response to the OP is obviously biased toward the logic flavor of computer science, with awkwardly scattered rec…

I largely agree with your sentiments.

However, you should keep in mind that these lists are intended as an answer to "What Math should we teach freshmen undergrads?", not an answer to "What Math do all the CS-people need to know?". The latter is naturally a very small subset of Math, the 'logicish' type.

I do STRONGLY agree with you that we should help students figure out the areas that they find interesting, and let them know what kind of Math is useful for each.

Re: Math topics useful for computer science/programming

#20
post #3

This does not seem very informed, starting from the false premise in the question up to the random concepts listed in the answers. Calculus is actually important for Computer Science, it's actually important for everything, it's where you learn how to handle the exponential function and the natural logarithm, how to do approximations and bounds, how to handle infinite series, etc., and those things then appear all ov…

> Calculus is actually important for Computer Science, it's actually important for everything, it's where you learn how to handle the exponential function and the natural logarithm, how to do approximations and bounds, how to handle infinite series, etc., and those things then appear all over the place, It's still interesting to think about which branches of math are actually applicable to programming itself. People…

Well there is the Curry-Howard correspondence. Though I don't know if this correspondence is intuitive in the general case - I guess what this correspondence means is that programs can be translated to some computational model, which can then be translated to some formal logic, and then back again (but with these kinds of high-level facts, I'm bound to have misunderstood something, somewhere). Though this connection might be only intuitive for some kinds of languages - like statically typed functional languages.

I think it's amazing that programming can leverage and express so many mathematical facts - from implementing a binary tree that is enforced to always be balanced by the type system in Haskell, to using linear types to safely use and free OS resources in ATS.

Post reply on HN