3 ms·
> 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
by chadcmulligan 6y ago
> 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
- kstrauser 6y agoThat'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?"
- gowld 6y ago^A + ^B = ^(A.B)
- chadcmulligan 6y agooops
- adjkant 6y agoI 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.