Boolean Algebra & Logic Gates

Answer & solution
Official answer: A
Recognize XOR, which is addition modulo 2. Swapping its two inputs preserves their sum modulo 2, proving commutativity. Grouping three inputs either way gives (p+q+r) mod 2, proving associativity. A truth table for only two inputs can show commutativity directly, but associativity needs the three-input relation or this algebraic argument.
Solution: The truth table is XOR. Both (a XOR b) XOR c and a XOR (b XOR c) give parity of the three bits, and a XOR b=b XOR a. Thus the operation is associative and commutative, A.



