---
tag: 0NNQ4KFEX7
kind: definition
name: Associativity
msc: [08A02]
defines: 0K8F7PVDMX
uses: [0580ZJSA3Q]
sources:
  - url: https://en.wikipedia.org/wiki/Associative_property
    locator: Definition
---

## Definition

Let $S$ be a set and let $\ast$ be a [[binary operation|0M418FE7BB]] on $S$.
The operation $\ast$ is associative when $(a \ast b) \ast c = a \ast (b \ast c)$ for all $a, b, c \in S$.

## Remarks

Addition and multiplication of real numbers are associative.
Subtraction of integers is not associative: $(1 - 1) - 1 = -1$, but $1 - (1 - 1) = 1$.
Composition of maps from a set to itself is associative.
For an associative operation, each way to put parentheses in $a_1 \ast a_2 \ast \cdots \ast a_n$ gives the same result.

## Explanations

### L1 human

Associativity says that you can do the operations in a chain in any grouping.
For example, $(2 + 3) + 4$ and $2 + (3 + 4)$ are both $9$.
Thus we can write $2 + 3 + 4$ without parentheses.
