Hacker News new | ask | show | jobs
by contravariant 268 days ago
I'm not seeing De Morgan. I am seeing inclusion exclusion, which is just a neat trick all round. Highly recommend remembering it.

I imagine negative filters to be a bit inefficient as well, though maybe not for a simple count.

1 comments

Inclusion-exclusion is just the generalization of De Morgan's law for more than 2 sets.

And the example shows exactly two sets.

So it's exactly De Morgan's law.