## Monday, May 2, 2011

### Commutativity and Associativity

This is the first of a three part post on the commutative and associative properties (stay tuned for parts two and three).

Commutativity: Order Doesn't Matter
When you add two things, the order in which you add them doesn't matter (2+4 is the same as 4+2). The name of this property is the commutative property. Examples of commutative operations are [note 1]:
Sometimes the order of things do matter. For example, division: $\inline \dpi{100} 4 \div 2$ is not the same as $\inline \dpi{100} 2 \div 4$ (the first is 2 the second is one half). When an operation does not commute, we call it non-commutative (that's simple enough). Some examples of non-commutativity are:

One important note on non-commutativity is that the operation doesn't have to be non-commutative on everything for it to be non-commutative. Take exponentiation for example, $\inline 2^4$ and $\inline 4^2$ are both 16. (Or if you're less mathematically inclined, use the examples of putting on your clothes: it doesn't matter if you put your pants on first, or your shirt.) An operation is still non-commutative if there's at least one pair of things that doesn't commute.

Associativity: I Don't Care Who You Hang Out With
When adding three (or more) numbers, it doesn't matter how you group those numbers. For example, if you wanted to add 2, 3 and 5, you could add 2 and 3, then add 5, or you could add 2 to 3 plus 5. This is much clearer with notation: 2+(3+5) is the same as (2+3)+5. The way you group the numbers doesn't change the answer. This is called this associativity. Other examples of associativity include:

You probably guessed it; some things are non-associative. The best example is division: $\inline \dpi{100} (12 \div 6) \div 2 = 2 \div 2$ is 1, but $\inline \dpi{100} 12 \div (6 \div 2) = 12 \div 3$ is 4. When dividing, the way you group things matters. Other non-associative examples include:
Conclusion
Commutativity and associativity are important mathematical concepts. In part 2, we'll be looking at something associative and non-commutative. In part 3, We'll look at something commutative and non-associative.

[Notes]
[1] Some of my examples come from Wikipedia, some of them I heard before (in a classroom or in a conversation), some of them I just made up.
[2]