The binary operator != is defined by the following truth table. p q | p != q : 0 0 -> 0 ; 0 1 -> 1 ; 1 0 -> 1 ; 1 1 -> 0. Which one of the following is true about the binary operator !=? A. Both commutative and associative B. Commutative but not associative C. Not commutative but associative D. Neither commutative nor associative
Read the operator as XOR: Outputs are 0,1,1,0 for inputs (0,0),(0,1),(1,0),(1,1) — output is 1 exactly when the bits differ, which is XOR.
Test commutativity: Rows (0,1) and (1,0) both give 1, and (0,0),(1,1) are already symmetric, so swapping inputs never changes the output. Commutative.
Test associativity: Both sides equal (p + q + r) mod 2 because addition modulo 2 can be regrouped. For example with p=1,q=1,r=1 both groupings give (1)!=1 = 0 vs 1!=(0) = 1... recompute: (1!=1)!=1 = 0!=1 = 1 and 1!=(1!=1) = 1!=0 = 1, equal.
Conclude: Commutative and associative selects option A.