# Check whether $G$ is group or not

Let $$G=\{0,1,2\}$$ define $$*$$ on $$G$$ such that $$a*b=|a-b|$$. Check if $$G$$ is a group.

Edit : As @egreg correctly pointed out if you draw the Cayley table then one can directly see it is not a group, I was making a mistake in drawing up Cayley table.

My solution : I can prove that $$G$$ is closed, has an identity ($$0$$), has an inverse (each element is inverse of itself).

What I am not sure is whether the group is associative under this binary operation, at the face of it $$|a-|b-c||\neq||a-b|-c||$$ but if we check all possibilities then both do come out to be equal if $$a,b,c \in G$$.

Any hint/help will be appreciated

• @Peter: I suspect at the level of this OP (reputation=1), that the statement that a group of size $3$ must be isomorphic to $\mathbb{Z}_3$ will be of little help. – David G. Stork Jun 13 '18 at 12:45
• Associativity is always the hardest property to verify but the good news is you don't have very many to check. You need to verify that $a*(b*c)=(a*b)*c$ so each letter has 3 choices $0,1,2$ so you'd have 27 things to check there if you manually check each one :) – N8tron Jun 13 '18 at 12:47
• You only need to find one combination of values for $a,b$ and $c$ for which associativity fails and you can infer that they cannot all be the same number and $0$ doesn't really change the expression so try combinations of $1$ and $2$. – CyclotomicField Jun 13 '18 at 12:48
• You may also use the fact that in a group each row/column of the Cayley table must be a permutation of the elements of $G$. – Andreas Caranti Jun 13 '18 at 12:48
• OK, an easier way to look if we CAN have a group : Does every element appear in every row and in every column ? If not, we cannot have a group. – Peter Jun 13 '18 at 12:49

The Cayley table (that also shows closure, identity and inverses) is \begin{array}{c|ccc} * & 0 & 1 & 2 \\ \hline 0 & 0 & 1 & 2 \\ 1 & 1 & 0 & 1\\ 2 & 2 & 1 & 0 \end{array} Since in the second row the element $1$ appears twice, the set is not a group.
In a group, from $xy=xz$ one deduces $y=z$; here, instead, $1*0=1*2$, but $0\ne2$.
The operation $$*$$ is not associative, since:\begin{align}\bigl||2-1|-1\bigr|&=0\\&\neq2\\&=\bigl|2-|1-1|\bigr|\end{align}and therefore, $$(G,*)$$ is not a group.
• Just wanted to add that associativity does work when $a=b=c$ or when any of the values is zero so to find a counter-example or prove associativity by brute force relatively few cases would need to be checked. – CyclotomicField Jun 13 '18 at 12:52