proofs

Verifying equivalence of a secret

Alice & Bob are both secret quadruple agents who could be working for the US, Russia or China. They want to come up with a scheme that would: a) if they are both working for the same side, prove this to each other so they can talk freely. b) if they are working for different sides, not expose any additional information about which side...

Why is (a | b ) equivalent to a - (a & b) + b?

I was looking for a way to do a BITOR() with an Oracle database and came across a suggestion to just use BITAND() instead, replacing BITOR(a,b) with a + b - BITAND(a,b). I tested it by hand a few times and verified it seems to work for all binary numbers I could think of, but I can't think out quick mathematical proof of why this is cor...