5 ms·
> 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 t
by superuser2 13y ago
> 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 tend to talk about programming and math as very strongly related, and of course there is the obvious relationship that "some computer programs do particular kinds of math" like you're talking about here.
But there is no (intuitive) overlap between writing, say, a web application and doing algebraic or calculus computation on paper. However, there are things like:
- Set theory underpinning relational databases
- Typed lambda calculus underpinning functional programming
I'd be interested in other examples like this.
- ThrustVectoring 13y agoI 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.
- nmrm 13y ago> 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.
- j2kun 13y agoMore simply (but hard to appreciate without going through semesters of work): know that structure-preserving mappings are the important parts.
- nmrm 13y agoYes. 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?
- j2kun 13y agoThe importance of structure preserving mappings shows up in many other places besides functional programming. I do believe context is important, but having multiple contexts is even better.
- shoki 13y agoWell, 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.
- tptacek 13y agoAs 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.
- platz 13y ago`ridiculously` might be hyperbole, but the two biggest ones I can think of are computer graphics and machine learning; these of which you can't even sneeze at without getting in linear algebra.
- tptacek 13y agoI have some sense of the linear algebra implicated in machine learning (I lived for many years with a comp. neuroscience PhD), but I have no visibility into graphics. So with my ignorance pinned to my lapel: the linear algebra involved in computer graphics is pretty simple, right? Just knowing how to manipulate vectors and matrices? Not a lot of eigenvalues, or for that matter orthogonalization? I'm asking not to rebut but because I hope to prompt the sort of "sell us on linear algebra" statement that will make me study harder. :)
- platz 13y agoDisclaimer: I'm not very experienced with CG, but I think your intuition is correct on CG, for lots of 'boilerplate' game or photoshop programming. However, I do think you can find plenty of examples in academia. For example, applying PCA http://cmp.felk.cvut.cz/~hlavac/TeachPresEn/11ImageProc/15PCA.pdf http://cmp.felk.cvut.cz/~hlavac/TeachPresEn/11ImageProc/15PC... (Perhaps this is just the result of crossover between CG and ML/Statistics here). Not a good sell, but perhaps someone with more experience can chime in.
- jfarmer 13y agoMuch of computer graphics operates in projective space (http://en.wikipedia.org/wiki/Projective_space http://en.wikipedia.org/wiki/Projective_space), so it's a little bit more than cookie-cutter linear algebra. This is done so that translations in 3D space — which aren't linear transformations — can be represented as 4D linear transformations in projective space via homogeneous coordinates (http://en.wikipedia.org/wiki/Homogeneous_coordinates http://en.wikipedia.org/wiki/Homogeneous_coordinates). Still, many folks use the APIs without really grokking that, so in practice it can be a bit cookie-cutter. I think of it similarly to how people can use crypto APIs without, say, really understanding what's going on under the hood. BTW, projective space is also intimately related to elliptic curves (as you may or may not know — not implying anything!). So that darn linear algebra is lurking all over the place. Likewise, any time you're talking about fields (even finite fields), vector spaces and linear algebra are right around the corner.
- joedavison 13y agoAnother example: - Linear algebra used in graphics and game programming
- Dewie 13y agoWell 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.
- stplsd 13y ago- number theory underpinning almost all modern cryptography - NFA/DFA underpinning regular expressions ( well practical regular exp are not in fact regular, but anyway)
- tptacek 13y agoActually, 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.