# What's the difference between the associative law and the commutative law?

Both laws say that for some operations the order in which the calculation happens does not affect the result. Where is the difference exactly?

-
One says the order of the parantheses doesn't matter, the other that the order of the terms doesn't matter. You can have associative non commutative laws but also commutative non associative laws. –  Olivier Bégassat Oct 24 '11 at 20:01
Does anyone know a nice minimal example for a commutative non-associative operation? –  Rasmus Oct 24 '11 at 20:16
$x\circ y = xy+1$ is commutative but not associative. –  Thomas Andrews Oct 24 '11 at 20:19
Pairwise averaging, $x\circ y:=(x+y)/2$, is also commutative but not associative. And matrix multiplication is associative but not commutative. –  Dustin Tran Oct 24 '11 at 20:24

The commutative law says that $X \circ Y = Y \circ X$ where $\circ$ is the operation under consideration (addition, multiplication, what have you). In words, you can swap the order of the two inputs of the operation and it won't matter.
The associative law says that $(X \circ Y) \circ Z = X \circ (Y \circ Z)$, where the parentheses tell you what you should be doing first. As you can tell, it's quite different: this is no longer about changing the order of the "things" you operate on, but rather the order of the operations themselves.