Discrete Mathematics
Propositional Logic
GATE 2015
Medium
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 ≠?
- Both commutative and associative
- BCommutative but not associative
- CNot commutative but associative
- DNeither commutative nor associative
Explanation
The truth table shown is exactly the XOR (exclusive-or) operator: p≠q = 1 iff p and q differ. XOR is well known to be commutative (p≠q = q≠p, symmetric table) and associative ((p≠q)≠r = p≠(q≠r), both equal 1 iff an odd number of p,q,r are 1) — so it is both commutative and associative.
Source: GATE CS 2015 (Session 1 / 7th Feb Shift 1) (2015)
This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.