01Numbers are rows of bits
In binary, 12 is 1100: bit 3 and bit 2 are on, worth 8 + 4. Bit i is worth 2^i, and we count positions from the right, starting at 0.
The bitwise operators work on every position independently, with no carries:
a & b(AND): 1 only where both bits are 1a | b(OR): 1 where at least one is 1a ^ b(XOR): 1 where the bits differ~a(NOT): flips every bit
So 12 & 10 = 8, 12 | 10 = 14, 12 ^ 10 = 6. XOR has a lovely property: x ^ x = 0 and x ^ 0 = x, so XOR-ing a list where every value appears twice except one leaves exactly the lonely value.