The nature of the AND operation (&):
- For any integer x, let x = x & (x-1), this operation can change the last 1 in the binary representation of x to 0.
The nature of the exclusive OR operation (⊕):
- Any number and 0 are XORed, the result is still the original number, that is, a ⊕ 0 = a.
- If any number is XORed with itself, the result is 0, that is, a ⊕ a = 0.
- The exclusive OR operation satisfies the commutative and associative laws, that is, a ⊕ b ⊕ a = b ⊕ a ⊕ a = b ⊕ (a ⊕ a) = b ⊕ 0 = b.