1. 11
evanmiller.org
1. 3

Mathematics is vital and fundamental to programming. The problem is, “mathematics” is a vast field that isn’t just arithmetic and calculus.

When I write code, I have to know some:

• arithmetic (obviously)
• algebra (the concept of factoring, variables, etc)
• predicate logic (conditionals, branches, filters, existence predicates, etc)
• set theory (collections, intersections, unions, and definitely anything dealing with databases)
• relational algebra (if dealing with relational databases)
• lattices (class hierarchies)
• ordering (total orders, partial orders, sorting, stable versus unstable sort)
• automata (regular expressions, parsers)
• combinatorics (count numbers of possible states, etc)
• algorithms (everything, plus Big-O)

All of these things are going to be known to a greater or lesser extent by even moderately-skilled hackers, even if the hacker doesn’t know that they know it. I understood predicate logic as a programmer long before I ever understood it as a pure mathematical discipline. I knew regular expressions long before I knew about automata theory. Total-versus-partial ordering comes up the first time you sort different datatypes.

The problem is that these things aren’t presented to “hackers” as “math”…they’re just “hacking”. I learned all the things in the above list long before I ever attended a formal computer science class (though obviously, I know them better now and know, especially, how much I didn’t know then and don’t know now).

The problem, in my opinion, with “pure” or “formal” mathematics is that I have no entry point. I learned about all those things because I had to to write software…and before I wrote software, I could use software. I could sit down and use an operating system and get an intuitive idea of “process” and “file” and all that, even if I didn’t actually know how they worked under the hood.

More “formal” mathematics is not something that you can do that with, though. I can’t sit down and “use” topology theory or number theory or whatever the way I can use a text editor. The difference between “hacker math” and “math” is that you can get to one by hacking and you get to the other by…I mean, I realize there’s experimenting with math and stuff but it’s not (at least not to me) like sitting down at a computer and playing around.

1. 2

I think this is a good observation. I’ve found that it’s easier to learn stuff when I’m curious about the result because it would help me solve a problem. I think a curriculum that used programming problems to motivate diving into the underlying math would be great for CS people, teach the process of going from a problem to calculating the more formal math, and then applying that.

At least, that sounds better than my CS degree, which had plenty of math and programming but rarely at the same time.

2. 1

Formal math isn’t about how to get “practical” or “useful” results from a technique, it’s about how and why the technique works at all. It’s all about proof. And you’re right, it’s difficult to learn because it’s so self-contained. Usually the entry points come from needing to go deeper into some particular application. Like, if you do 3D graphics you might eventually need to understand why quaternions don’t commute.

If you want to play with math like you’d play with an OS or a programming language, install SageMath or something similar, and just start working through some tutorials and textbooks. It’s not really all that different. You might just need to re-calibrate your expectations about what “use” means.