Operations that are commutative but non-associative on a set of only two elements?

213 Views Asked by At

Let's say I have a simple set of two arbitrary elements $E =$ {$a,b$}. I want to find an operation which is commutative but not associative. How do I go about this? Also, testing associativity with elements of this set would require me to use the same elements more than once, right? For example:

$$a * (b * a) \ne (a * b) * a,$$

as well as

$$ a * (a * a) \ne (a * a) * a. $$

My trouble is, I don't even understand how this could be done, am I misunderstanding something about the exercise? If $*$ is commutative, then $a * (b * a)$ = $a * (a * b)$ = $(a * b) * a$, thus making the law associative. What's wrong with my logic?

1

There are 1 best solutions below

5
On BEST ANSWER

It is true that there might not be many examples (you could actually write down all the $2^4=16$ possible multiplication tables and see how many are commutative and/or associative), but here is one example:

Define $a*b = b*a = a*a = b$ and $b*b=a$. Clearly this operation is commutative. But it is not associative, because for instance $(a*b)*b=a \neq b = a*(b*b)$.