Answer: C
An operation ∗ is defined as:
- Commutative if A∗B=B∗A
- Associative if (A∗B)∗C=A∗(B∗C)
Let's evaluate the given operations:
- AND (⋅):
- Commutative: A⋅B=B⋅A (True)
- Associative: (A⋅B)⋅C=A⋅(B⋅C) (True)
- OR (+):
- Commutative: A+B=B+A (True)
- Associative: (A+B)+C=A+(B+C) (True)
- NAND (↑):
- Commutative: A↑B=A⋅B=B⋅A=B↑A (True)
- Associative: Let's compare the left-hand side (LHS) and right-hand side (RHS):
- LHS=(A↑B)↑C=AB⋅C=AB+C
- RHS=A↑(B↑C)=A⋅BC=A+BC
Since LHS=RHS (for instance, with A=1,B=1,C=0, we get LHS=1 and RHS=0), NAND is not associative.
- EXOR (⊕):
- Commutative: A⊕B=B⊕A (True)
- Associative: (A⊕B)⊕C=A⊕(B⊕C) (True)
Thus, NAND is commutative but not associative.