Live data from Hacker News

Math topics useful for computer science/programming

matheducators.stackexchange.com

21–30 of 69 posts

Re: Math topics useful for computer science/programming

#21
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…

There's also thunk/trampolining continuation style to convert recursion easily into something that is not stack limited. http://nathansuniversity.com/cont.html

Re: Math topics useful for computer science/programming

#22
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…

I certainly agree. I'm trying to re-learn advanced calculus and analysis from a rigorous standpoint, as I think it is crucial for developing deep knowledge in probability theory, among other things.

Slightly tangential but, while there are many lovely books for linear algebra (like Halmos, Axler or Hoffman & Kunze), as a newcomer I don't find analysis literature so exciting. The standard, Rudin, is really synthetic Bourbaki-style. I like short and precise books, but I found it really removes most intuition. Any good books you happen to like? Perhaps Pugh or Zorich?

Re: Math topics useful for computer science/programming

#23
Why not teach math + programming together? I didn't seem to see anyone suggest that.

Calculus: simplify and iterate to solve a problem (like Newton's Method). Lots of issues to tackle with. Much more useful than learning formulas, but it can also be interesting to show how converting forms can take an unstable problem into a stable one.

Combinatorics: Explore the small side of a problem, code up the larger version, explore how far one can get, show methods for dealing with the problem beyond the scope.

Graphics, user interface design, etc., are also very big in math. In a course I teach to Enviro Science people, they come in scar(r)ed of math and by the end, they enjoy it. A big trick is getting them to use GeoGebra in an exploratory, visual fashion. It makes the math real.

The same approach in code can help make CS students get math while also getting the issues in CS. Anyone who thinks the exponential as 1+ x+ x^2/2 + .... is useful as is for x = 100 needs some actual experience with it. But at the same time, teaching them how to translate e^100 ~~ e^(43ln(10) + .98) ~~ 10^43 (1 + .98 + .98^2/2 + .98^3/6) = 10^43 * 2.62 has its value (compare to e^100 ~~ 2.69 * 10^43)

This is the kind of math that is useful. Exploratory math that struggles with mathematical truths and practical implementations. Students should get a sense of the limits of computers, what they can handle and not.

And designing a good math interface for these problems can be quite the UI learning experience. There are so many ways to explore math.

Stop teaching dry math and start teaching programming math.

Re: Math topics useful for computer science/programming

#24
post #22
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…

I certainly agree. I'm trying to re-learn advanced calculus and analysis from a rigorous standpoint, as I think it is crucial for developing deep knowledge in probability theory, among other things. Slightly tangential but, while there are many lovely books for linear algebra (like Halmos, Axler or Hoffman & Kunze), as a newcomer I don't find analysis literature so exciting. The standard, Rudin, is really synthetic B…

Interested in a range of book recommendations for Calculus on up.

Re: Math topics useful for computer science/programming

#25
post #23

Why not teach math + programming together? I didn't seem to see anyone suggest that. Calculus: simplify and iterate to solve a problem (like Newton's Method). Lots of issues to tackle with. Much more useful than learning formulas, but it can also be interesting to show how converting forms can take an unstable problem into a stable one. Combinatorics: Explore the small side of a problem, code up the larger version, e…

Linear algebra/vector algebra is the single most useful topic for programming I can imagine.

Re: Math topics useful for computer science/programming

#26
Which area of math isn't useful for computer science/programming? Certainly some areas are more useful than others, but I think rather than looking at areas it matters more how in depth you go in one area. Going super deep into an area is often not a lot more useful than just knowing the basics. Complexity theory is useful, but it's not that practically useful to know deeply about all the complexity classes.

Re: Math topics useful for computer science/programming

#27
post #22
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…

I certainly agree. I'm trying to re-learn advanced calculus and analysis from a rigorous standpoint, as I think it is crucial for developing deep knowledge in probability theory, among other things. Slightly tangential but, while there are many lovely books for linear algebra (like Halmos, Axler or Hoffman & Kunze), as a newcomer I don't find analysis literature so exciting. The standard, Rudin, is really synthetic B…

Among the many texts almost the only one I really liked and learnt from is Courant's "Differential and Integral calculus" and the newer edition "Introduction to Calculus and Analysis". It doesn't do the typical modern division of topics and instead treats single-variable calculus, multi-variable calculus and real analysis in its two volumes in a single long sequence, but the writing style is very pleasant and the exposition very intuitive, and it includes a lot of physics applications. Hardy "A course of pure mathematics" is great too, but it is much more, well, pure, but it stays relatively intuitive and the clarity with which he writes is unparalleled, many things I first really understood from this book. Those are old texts though and notation and details of exposition differ here and there from modern standards.

I have the book by Pugh, but that one is pure^2, even as far as analysis texts go, the problems are difficult and there are no solutions, so I think it would work only for people very in love with absolutely pure mathematics and most likely only in an academic setting, while I am interested in applications and self-studying. From modern texts, given your interests, I would look at "Understanding analysis" by Abbott and "Measure, Integral and Probability" by Capinski, both pleasant to read and together providing a not too steep path toward measure-theoretic probability.

Re: Math topics useful for computer science/programming

#28
post #23

Why not teach math + programming together? I didn't seem to see anyone suggest that. Calculus: simplify and iterate to solve a problem (like Newton's Method). Lots of issues to tackle with. Much more useful than learning formulas, but it can also be interesting to show how converting forms can take an unstable problem into a stable one. Combinatorics: Explore the small side of a problem, code up the larger version, e…

Linear algebra/vector algebra is the single most useful topic for programming I can imagine.

And yet, so many coders don't know linear algebra.

Re: Math topics useful for computer science/programming

#29
I wrote the original question. I've always been interested in how much math various careers use, but I wrote this question the way I did in a shameless attempt to drive traffic to the site by appealing to the Stackoverflow and reddit communities. Everyone has given me a different answer so far, but that's to be expected, because there are ~1000 subcategories of computer programmers.

Re: Math topics useful for computer science/programming

#30

Earlier quoted context omitted.

> 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 meanin…

> Abstract algebra and category theory are likely relevant, especially for metaprogramming.

In general, the whole "oh yeah CS people should know some category theory and abstract algebra" is pretty hilarious.

First, it's a bit like saying "oh yeah CS people need to know the undegraduate basics and also the generalization that most mathematicians don't encounter until a couple years into grad school."

Second, most people who say this really mean "a conceptual grasp on different types of morphisms is useful". But that's like saying you need calculus in order to drive a car; or, in the case of categories, it's like saying you need two semesters of real analysis in order to drive a car.

Why not just say "knowing about different sorts of mappings is pretty useful in functional programming"? Knowing how this generalizes to more abstract mathematical objects is totally unnecessary.

Post reply on HN