Simple puzzle: can you come up with a binary operator over integers that is commutative and associative, but has no identity element? For example, addition is commutative because \(x+y=y+x\)
and associative because \((x+y)+z=x+(y+z)\)
, but it does not satisfy the puzzle because \(0\)
is an identity element: \(x+0=x\)
. Likewise, multiplication does not work because \(1\)
is an identity element. \(\text{ }f(x,y)=xy+1\)
is commutative and has no identity element, but is not associative. There is at least one (and probably more) trivial, degenerate solution(s), so I’ll give another restraint: the range of the operator must also be the entire set of integers.
If you prefer a more formal phrasing, find \(f:\mathbb{Z}\times\mathbb{Z}\rightarrow\mathbb{Z}\)
such that:
Update: solutions posted