Examples
Some examples of associative operations include the following.
- The concatenation of the three strings
"hello"
," "
,"world"
can be computed by concatenating the first two strings (giving"hello "
) and appending the third string ("world"
), or by joining the second and third string (giving" world"
) and concatenating the first string ("hello"
) with the result. The two methods produce the same result; string concatenation is associative (but not commutative).
- In arithmetic, addition and multiplication of real numbers are associative; i.e.,
-
- Because of associativity, the grouping parentheses can be omitted without ambiguity.
- Addition and multiplication of complex numbers and quaternions is associative. Addition of octonions is also associative, but multiplication of octonions is non-associative.
- The greatest common divisor and least common multiple functions act associatively.
- Taking the intersection or the union of sets:
- If M is some set and S denotes the set of all functions from M to M, then the operation of functional composition on S is associative:
- Slightly more generally, given four sets M, N, P and Q, with h: M to N, g: N to P, and f: P to Q, then
- as before. In short, composition of maps is always associative.
- Consider a set with three elements, A, B, and C. The following operation:
-
× A B C A A A A B A B C C A A A
- is associative. Thus, for example, A(BC)=(AB)C. This mapping is not commutative.
- Because matrices represent linear transformation functions, with matrix multiplication representing functional composition, one can immediately conclude that matrix multiplication is associative.
Read more about this topic: Associative Property
Famous quotes containing the word examples:
“Histories are more full of examples of the fidelity of dogs than of friends.”
—Alexander Pope (16881744)
“It is hardly to be believed how spiritual reflections when mixed with a little physics can hold peoples attention and give them a livelier idea of God than do the often ill-applied examples of his wrath.”
—G.C. (Georg Christoph)
“No rules exist, and examples are simply life-savers answering the appeals of rules making vain attempts to exist.”
—André Breton (18961966)
Related Phrases
Related Words