Commutativity is a property that may be had by an operation involving two numbers or other mathematical elements. A binary (two-element) operation is commutative if it does not matter which element is named first.
For example, because addition is commutative, 5 + 7 has the same value as 7 + 5. Subtraction, on the other hand, is not commutative, and the difference 5 − 7 does not have the same value as 7 − 5.
Commutativity can be described more formally. If * stands for an operation and if A and B are elements from a given set, then * is commutative if, for all such elements A * B = B * A.
In ordinary arithmetic and algebra, the commutative operations are multiplication and addition. The non-commutative operations are subtraction, division, and exponentiation. For example, x + 3 is equal to 3 + x; xy is equal to yx; and (x + 7)(x − 2) is equal to (x − 2) (x + 7). On the other hand, 4−3x is not equal to 3x − 4; 16/4 is not equal to 4/16; and 52 is not equal to 25.
The commutative property can be associated with other mathematical elements and operations as well. For instance, one can think of a translation of axes in the coordinate plane as an “element,” and following one translation by another as a “product.” Then, if T 1 and T 2 are two such translations, T 1T 2 and T 2T 1 are equal. This operation is commutative. If the set of transformations includes both translations and rotations, however, then the operation loses its commutativity. A rotation of axes followed by a translation does not have the same effect on the ultimate position of the axes as the same translation followed by the same rotation.
An operation * is associative if for all A, B, and C, (A * B) * C = A * (B * C). When an operation is both commutative and associative, it can be applied to a finite number of elements in any order. This is particularly useful in simplifying an expression such as x2 + 5x + 8 + 2x2 + x + 9. One can combine the squared terms, the linear terms, and the constants without tediously and repeatedly using the associative and commutative properties to bring like terms together. In fact, because the terms of a sum can be combined in any order, the order need not be specified, and the expression can be written without parentheses. Because ordinary multiplication is both associative and commutative, this is true of products as well. For example, the expression 5x2y3z, with its seven factors, requires no parentheses.