Hacker News new | ask | show | jobs
by kstrauser 2150 days ago
* Truth tables and Karnaugh maps blew my mind, as did the rest of Boolean math. I loved finding a way to formally think about things I'd vaguely and unrigorously thought about before, and the notion of mathematics without numbers opened my eyes.

* I loved political science and sociology classes. I would not have predicted that.

* I use my physics classes all the time, but never in ways I would have anticipated. "Hey, I wonder how high we are. Here's a rock we can toss down into that pond. Get your stopwatch!"

* I very rarely find myself working with finite state machines, but when I do, it's nice to feel comfortable reasoning about them.

* Big-O notation? All the freaking time. That's an enormously powerful tool for thinking about how systems will scale with the number of users, for instance.

2 comments

> I very rarely find myself working with finite state machines, but when I do, it's nice to feel comfortable reasoning about them.

When you recognize a state machine somewhere it makes the code and everything around it so much simpler.

It really, really does. It's not the correct tool for every job, but when it's right, it's very right.
> Truth tables and Karnaugh maps blew my mind, as did the rest of Boolean math

Indeed, DeMorgans law is something I use regularly, but many devs don't know it

(^A.^B) = ^(A+B)

^A + ^B = ^A.^B

I didn't realize how much I used this or other forms of boolean expression simplification/translation until this comment tbh. Really goes to show that while much of formal CS won't be used in industry, some of it in random places can be surprisingly useful.
That's an incredibly powerful simplification in the right places. It's so satisfying when you can remove a bunch of "not"s from code and get something that's mathematically identical but a whole lot easier to read.

Heh! I also used it recently (and successfully) to argue with a particular vendor whose query language did not respect that transformation. I re-wrote a "not A and not B" expression to "not (A or B)", and the query broke. It was nice to be able to point them to the Wikipedia article and say "no, if your query language doesn't treat those as identical, then it's a bug and would you please fix it now?"

^A + ^B = ^(A.B)
oops