For example, the operation addition is commutative on the most commonly used number systems (the complex numbers and its subsets such as the real numbers, integers, etc.) because . However, the operation of division is not commutative over these sets because usually .
Formally, an operation is commutative if and only if .
An operation which is not commutative is said to be noncommutative.
- The integers commute under both addition and multiplication, but not subtraction or division.
- Some functions commute under composition. For example, the functions , for all (with taking values in the positive integers) commute: .
- Function composition is not, in general, commutative. For example, composing two linear transformations between three vector spaces corresponds to multiplying the corresponding matrices, and matrix multiplication does not commute in general. In particular, let be a matrix and a matrix. Then and are matrices of sizes and , respectively.