Live data from Hacker News

Math topics useful for computer science/programming

matheducators.stackexchange.com

41–50 of 69 posts

Re: Math topics useful for computer science/programming

#41
post #32
post #30

Earlier quoted context omitted.

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

More simply (but hard to appreciate without going through semesters of work): know that structure-preserving mappings are the important parts.

Yes. But my more important point is that you can tach about these mappings in isolation, in the context of functional programming. No Category Theory needed.

You can teach about "different sorts of mappings" in just about any setting. In fact, that's kind of the whole reason Category Theory exists. So why teach the general result when all you care about is its application to functional programming?

Re: Math topics useful for computer science/programming

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

- number theory underpinning almost all modern cryptography

- NFA/DFA underpinning regular expressions ( well practical regular exp are not in fact regular, but anyway)

Re: Math topics useful for computer science/programming

#43
post #40
post #38

Earlier quoted context omitted.

Well, frankly you can get along not knowing the "Gang of Four" design patterns and write Java. By the same token, you don't need to know about iterables and comprehensions to write Python, smart pointers to write C++, Graph theory to use a Graph database, macros to write LISP, etc. By analogy, you don't need to know abstract algebra and category theory to write Haskell. But as in the other cases, knowing helps .

I think you misunderstood my criticism. "Different sorts of mappings" is NOT synonymous with "category theory". Not even close. Heck, Euclid knew about "different sorts of mappings". Most everything in Gamma et al is arguably useful for everyday programming in Java. Maybe 5-10 pages of MacLane is useful for everyday programming in functional languages. Unless by "Category Theory" you mean "5-10 pages of MacLane", Cat…

Functional Programming is a vast subject.

I've really never needed an abstraction for semigroups, monoids, meet-semi-lattices, monads, comonads, arrows or catamorpisms in Clojure, Common Lisp, Scheme, or Hy.

These concepts become more relevant when I program Haskell, Agda, Isabelle/HOL, or Coq.

I'd say a stronger analogy can be made between reading MacLane's Catagories for the Working Mathematician and reading Hoyte's Let Over Lambda; you really only need to read a little bit of these books to get the core concepts. That being said, depending on what sort of functional programming you're doing, a strong background in category theory or meta-programming can enabling (or not).

Re: Math topics useful for computer science/programming

#44
post #42

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…

- number theory underpinning almost all modern cryptography - NFA/DFA underpinning regular expressions ( well practical regular exp are not in fact regular, but anyway)

Actually, although number theory touches a lot of "conventional" crypto (some of the design rationale for AES, polynomial MACs), most of workhorse cryptography in normal applications is not especially number-theoretic, and has more to do with information theory and statistics.

The belief that number theory is essential for cryptography is due to its role in public-key cryptography. But even if you're comfortable with number theory, new applications of public-key cryptography are tremendously difficult to get right, and require subject-matter specific expertise.

Re: Math topics useful for computer science/programming

#45

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…

As someone currently teaching themselves linear algebra (via Strang), I'm curious as to why you believe linear algebra is ridiculously important. I see its applications to graph programming and obviously to cryptography, but I've done a lot of work in both of those subjects and never strictly needed a background in linear algebra to be effective.

Re: Math topics useful for computer science/programming

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

This comment is a little frustrating, because part of the point of linking to the Stack Overflow post is to continue the discussion, which is obviously germane to our site. Why not dig into specifics of how you'd approach the intersection of math and CS?

Re: Math topics useful for computer science/programming

#47
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.

Why?

Re: Math topics useful for computer science/programming

#48
post #35
post #34

What would be a good writeup for understanding term-rewriting? (My current background level: I understand most of what OP has listed in "actually useful" and "can run into", and "automata theory" from the third list.)

I wouldn't recommend it as being as important as the OP claims, but if you must: http://www21.in.tum.de/~nipkow/TRaAT/

Thanks!

Could you also recommend something on how symbolic computation works? I have used computer algebra systems like Mathematica for long; would like to understand how it works internally.

I currently understand some basics like DPLL, semantic first-order unification, methods of solving specific equation systems like linear systems, numerical differential equations, etc. I am missing at least how the "top-level" of symbolic computation works.

For example, from what I currently understand, first-order semantic unification can find "x = Cos[y]" from "Sin[x] = Sin[Cos[y]]", but cannot solve "Sin[x] = Cos[x]" for x, and cannot simplify "[(Sin[x])^2 + (Cos[x])^2] = 1" to True.

I am hoping to find something simpler than reading through SymPy source code. :-)

Re: Math topics useful for computer science/programming

#49
post #27
post #22

Earlier quoted context omitted.

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

Thanks for taking the time to write such a thorough reply. I find Abbott a bit imprecise sometimes, but Courant is a fantastic book. Could you also mention to some of your favorite math references, in particular those that deal with probability theory and statistics?

Re: Math topics useful for computer science/programming

#50
post #48
post #35

Earlier quoted context omitted.

I wouldn't recommend it as being as important as the OP claims, but if you must: http://www21.in.tum.de/~nipkow/TRaAT/

Thanks! Could you also recommend something on how symbolic computation works? I have used computer algebra systems like Mathematica for long; would like to understand how it works internally. I currently understand some basics like DPLL, semantic first-order unification, methods of solving specific equation systems like linear systems, numerical differential equations, etc. I am missing at least how the "top-level" o…

Peter Norvig's PAIP book has a chapter devoted to Student, a computer algebra system. It's very didactic:

http://norvig.com/paip/student.lisp

Post reply on HN