I need examples of binary operations for real numbers that are
- associative and commutative
- associative but not commutative
The examples are for a programming class and need to be rather simple. Thus the operations have to work on real numbers and not on sets or matrices (which I would have to explain to the audience). The Fibonacci numbers would be a good counterexample.
The obvious choice for 1. would be multiplication and addition, but I would like to have another example to improve understanding.
Important is also that I need to be able to chain the operations. So the associative and commutative property should not only hold (or not hold) to a OPERATION b but also to a OPERATION b OPERATION c OPERATION d .... For example
$a\ MEAN\ b := \frac{a + b}{2}$
is associative and commutative for only $a$ and $b $, but not for $a\ MEAN\ b\ MEAN\ c\ MEAN\ d$.