# Real life examples of commutative but non-associative operations

I've been trying to find ways to explain to people why associativity is important. Subtraction is a good example of something that isn't associative, but it is not commutative.

So the best I could come up with is paper-rock-scissors; the operation takes two inputs and puts out the winner (assuming they are different).

So (paper rock) scissors= paper scissors = scissors,

But paper (rock scissors)= paper rock = paper.

This is a good example because it shows that associativity matters even outside of math.

What other real-life examples are there of commutative but non-associative operations? Preferably those with as little necessary math background as possible.

• Your question is distinct, but these two questions are closely related: math.stackexchange.com/questions/327422/… and math.stackexchange.com/questions/160945/…. Dec 15, 2013 at 20:49
• The most "real-life" (or otherwise simplest) examples from the linked questions seem to be the operations: sending $(A,B)$ to the midpoint of $A$ and $B$, and $(x,y) \mapsto xy +1$ on the integers. Dec 15, 2013 at 20:52
• Mixing chemicals in chemistry is not necessarily associative when considering physical factors: i.e. suspensions/colloids. I do not know of an example where chemically mixing is not associative. The midpoint operation can be visualized with strings, where $(A,B)$ means you cut (or otherwise mark) at the midpoint of $A$ and $B$. Dec 15, 2013 at 20:59
• What's this "real-life" thing? Dec 16, 2013 at 10:22
• See this answer; is "nor" not a real life example?
– bof
Jan 23, 2016 at 6:44

Let $$\circ$$ be the "function" of $$a$$ and $$b$$ having a child. Then $$(a\circ b)\circ c \neq a\circ(b\circ c),$$ where I assume asexual reproduction...

• I am not sure whether a +1 is in order for a good answer, or a -1 for suggestions of incest. Very good example for why associativity is important. Dec 15, 2013 at 21:01
• @Eric thanks, but it only works fine for asexual reproduction... Dec 15, 2013 at 21:21
• I was interpreting as $\circ$ takes two people and outputs their child. Then $(a\circ b)\circ c$ is the child made by (the child of $a$ and $b$) and $c$. And $a\circ(b\circ c)$ is the child of $a$ and (the child of $b$ and $c$). Taking $a$, $b$, and $c$ as the top nodes, you may draw the family tree, and see that in terms of DNA, the operation is not associative. I suppose it is not incest actually though, but does suggest a wide age gap between couples. Dec 16, 2013 at 1:25
• Since $x\circ y$ is not defined for $x$ and $y$ both male or both female, $\circ$ is clearly a halfoperation over the set of human beings. Jul 31, 2015 at 23:34
• This does not assume asexual reproduction if $a$ and $c$ are of one sex and $b$, $a\circ b$ and $b\circ c$ are of another. It also does not contain an incest if $a$, $b$ and $c$ are genetically unrelated, because then $a\circ b$ is unrelated to $c$ and $a$ is unrelated to $b \circ c$. It only implies relatively large (at least one generation) age differences. Aug 27, 2018 at 13:22

The averaging operation, defined by $$a\oplus b= \frac{a+b}2$$ is commutative but not associative.

Brian Rushton finds inspiration in cooking, his family and his dog.

vs.

Brian Rushton finds inspiration in cooking his family and his dog.

Shows pretty well how associativity makes a difference.

• I've rolled this answer back to its previous state, I'm 99% sure the previous edit was not at all appropriate -- perhaps as a comment, but certainly not as a revised answer. Feb 29, 2016 at 20:25
• @pjs36, thank you. I also think that it wasn't appropriate. For reference, the comment was "Shouldn't we care about the fact that the word 'cooking' has two different meanings (noun vs verb or object vs process) in the two sentences?" Feb 29, 2016 at 21:10
• Sure! Yes, it took me a while to piece it together, but something seemed off. It was a pretty good comment, just not a good revision! Feb 29, 2016 at 21:30

Mixing (same amount of ) primary colors:

(red + blue ) + blue = purple + blue = blue purple,

red + ( blue + blue ) = red + blue = purple.

• Do you mean light or paint? Dec 15, 2013 at 21:26
• I was thinking about paint on a canvas Dec 15, 2013 at 21:27
• And also, if you took two grams of blue paint and one gram of red paint, the end result would be the same shade no matter the order you mixed them in. Dec 15, 2013 at 23:42
• @Boluc Papuccuoglu yes and shouldn't it be the answer mixing equal amounts of primary colors? Feb 7, 2015 at 11:40
• Also: water+(flour+yeast)$\ne$(water+flour)+yeast !! Feb 7, 2015 at 11:44