May 09, 2011 21:07
XOR is a lot of fun and I've talked about it before. I'm not particularly concerned about this being the least suitable forum for this discussion. LJ is mostly dead it seems, other than as a space for weird survey memes.
Sometimes you are at an exam, and you forget some important mathematical property or definition. And then you set out to prove the thing asked of you in the problem, except that with your incomplete or flawed knowledge base it is actually impossible to prove.
But while you're trying really hard you have a fun time thinking about the subject at hand, since you are forced to really examine it in detail.
I did this with a problem that involved expressing XOR in a certain way. While I was trying to do this, I came up with a fun list of ways to express XOR, given below.
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0
XOR is also:
if NOT(A) then B, if A then NOT(B)
abs(A-B)
A+B mod 2
(A OR B) AND NOT(A AND B)
Or if you redefine 'false' to be -1, and 'true' is still defined 1, you can do A*B
I imagine there are many others...