Commutative operations •
Addition and
multiplication are commutative in most
number systems, and, in particular, between
natural numbers,
integers,
rational numbers,
real numbers and
complex numbers. This is also true in every
field. • Addition is commutative in every
vector space and in every
algebra. •
Union and
intersection are commutative operations on
sets. • "
And" and "
or" are commutative
logical operations.
Noncommutative operations •
Division is noncommutative, since 1 \div 2 \neq 2 \div 1.
Subtraction is noncommutative, since 0 - 1 \neq 1 - 0. However it is classified more precisely as
anti-commutative, since x - y = - (y - x) for every and .
Exponentiation is noncommutative, since 2^3\neq3^2 (see
Equation xy = yxEquation xy = yx). • Some
truth functions are noncommutative, since their
truth tables are different when one changes the order of the operands. For example, the truth tables for and are : •
Function composition is generally noncommutative. For example, if f(x)=2x+1 and g(x)=3x+7. Then (f \circ g)(x) = f(g(x)) = 2(3x+7)+1 = 6x+15 and (g \circ f)(x) = g(f(x)) = 3(2x+1)+7 = 6x+10. •
Matrix multiplication of
square matrices of a given dimension is a noncommutative operation, except for matrices. For example: \begin{bmatrix} 0 & 2 \\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} 0 & 1 \\ 0 & 1 \end{bmatrix} \neq \begin{bmatrix} 0 & 1 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ 0 & 1 \end{bmatrix} • The vector product (or
cross product) of two vectors in three dimensions is
anti-commutative; i.e., \mathbf{b} \times \mathbf{a} = -(\mathbf{a} \times \mathbf{b}) . ==Commutative structures==