Question 7
Binary OperationsWhich of the following binary operations is not commutative?
- A.a * b = 1/a + 1/b
- B.a * b = a + b − ab
- C.a * b = 2a + 2b + ab
- D.a * b = a − b + ab
Show the answer and explanation
Answer: D (a * b = a − b + ab)
Explanation
Swapping a and b changes a − b + ab into b − a + ab, which is different. The other rules stay the same when a and b swap.