Associative operation
Elementary
A way of combining numbers is associative if, when you combine three numbers in a row, it doesn’t matter which pair you combine first, such as $(2 + 3) + 4 = 2 + (3 + 4)$.
Undergraduate (abstract algebra)
Consider a set $S$ with a binary operation $\ast$. The operation $\ast$ is associative if
\[(a \ast b) \ast c = a \ast (b \ast c) \quad \text{for all } a, b, c \in S.\]Examples
Examples
-
Addition $+$ on $\reals$
Elementary
Addition on $\reals$ is associative: for example, $(2 + 3) + 4 = 2 + (3 + 4) = 9$.
-
Multiplication $\times$ on $\reals$
Elementary
Multiplication on $\reals$ is associative: for example, $(2 \times 3) \times 4 = 2 \times (3 \times 4) = 24$.
-
Multiplication of $2 \times 2$ real matrices
Undergraduate
Multiplication of $2 \times 2$ matrices is associative, because $(A B) C$ and $A (B C)$ both represent the composition of the same three linear maps. For example, multiplying the first two matrices first and multiplying the last two matrices first give the same product: \[\left( \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 \\ 1 & 1 \end{bmatrix} \right) \begin{bmatrix} 2 & 0 \\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 2 & 1 \\ 1 & 1 \end{bmatrix} \begin{bmatrix} 2 & 0 \\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 4 & 1 \\ 2 & 1 \end{bmatrix},\] \[\begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix} \left( \begin{bmatrix} 1 & 0 \\ 1 & 1 \end{bmatrix} \begin{bmatrix} 2 & 0 \\ 0 & 1 \end{bmatrix} \right) = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} 2 & 0 \\ 2 & 1 \end{bmatrix} = \begin{bmatrix} 4 & 1 \\ 2 & 1 \end{bmatrix}.\]
Non-examples
Things that may be mistaken for examples.
-
Subtraction $a - b$ on $\reals$
Elementary
Subtraction on $\reals$ is not associative, because $(5 - 3) - 1 = 1$, but $5 - (3 - 1) = 3$.
Properties
- Addition and multiplication of real numbers are associative, and so are composition of functions and multiplication of matrices.
- Subtraction is not associative: $(5 - 3) - 1 = 1$, but $5 - (3 - 1) = 3$.
- Associativity is different from commutativity: matrix multiplication is associative, but $A B$ and $B A$ can differ.
Distinctions involving this term
- Associative vs. commutative: Consider a binary operation, such as addition, that combines two inputs, such as two numbers, into one result. Associativity and commutativity both involve changing an order, but they change the order of different things. An associative operation gives the same result when the order in which the operations are performed changes, while the inputs stay in place, as in $(a \ast b) \ast c = a \ast (b \ast c)$: on the left, $a \ast b$ is computed first; on the right, $b \ast c$ is computed first. A commutative operation gives the same result when the order of the inputs changes, as in $a \ast b = b \ast a$: $a$ and $b$ trade places. An operation can have either property without the other.