All Topics  
Associativity

 

   Email Print
   Bookmark   Link






 

Associativity



 
 
In mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, associativity is a property that a binary operation
Binary operation

In mathematics, a binary operation is a calculation involving two operands, in other words, an operation whose arity is two. Binary operations can be accomplished using either a binary function or binary operator....
 can have. It means that, within an expression containing two or more of the same associative operators in a row, the order that the operations are performed does not matter as long as the sequence of the operand
Operand

An operand is one of the inputs of an operator in mathematics. The following arithmetic expression shows an example of operators and operands:...
s is not changed. That is, rearranging the parentheses
Bracket

Brackets are punctuation marks used in pairs to set apart or interject text within other text. In computer science, the term is sometimes said to strictly apply to the square or box type....
 in such an expression will not change its value. Consider for instance the equation

Even though the parentheses were rearranged (the left side requires adding 5 and 2 first, then adding 1 to the result, whereas the right side requires adding 2 and 1 first, then 5), the value of the expression was not altered.






Discussion
Ask a question about 'Associativity'
Start a new discussion about 'Associativity'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, associativity is a property that a binary operation
Binary operation

In mathematics, a binary operation is a calculation involving two operands, in other words, an operation whose arity is two. Binary operations can be accomplished using either a binary function or binary operator....
 can have. It means that, within an expression containing two or more of the same associative operators in a row, the order that the operations are performed does not matter as long as the sequence of the operand
Operand

An operand is one of the inputs of an operator in mathematics. The following arithmetic expression shows an example of operators and operands:...
s is not changed. That is, rearranging the parentheses
Bracket

Brackets are punctuation marks used in pairs to set apart or interject text within other text. In computer science, the term is sometimes said to strictly apply to the square or box type....
 in such an expression will not change its value. Consider for instance the equation

Even though the parentheses were rearranged (the left side requires adding 5 and 2 first, then adding 1 to the result, whereas the right side requires adding 2 and 1 first, then 5), the value of the expression was not altered. Since this holds true when performing addition on any real number
Real number

In mathematics, the real numbers may be described informally in several different ways. The real numbers include both rational numbers, such as 42 and −23/129, and irrational numbers, such as pi and the square root of two; or, a real number can be given by an infinite decimal representation, such as 2.4871773339...., where the digits co...
s, we say that "addition of real numbers is an associative operation."

Associativity is not to be confused with commutativity
Commutativity

In mathematics, commutativity is the process to change the order of something without changing the end result. It is a fundamental property of many binary operations throughout mathematics, and many Mathematical proof depend on it....
. Commutativity justifies changing the order or sequence of the operands within an expression while associativity does not. For example,

is an example of associativity because the parentheses were changed (and consequently the order of operations during evaluation) while the operands 5, 2, and 1 appeared in the exact same order from left to right in the expression.

is not an example of associativity because the operand sequence changed when the 2 and 5 switched places.

Associative operations are abundant in mathematics, and in fact most algebraic structure
Algebraic structure

In algebra, a branch of pure mathematics, an algebraic structure consists of one or more Set Closure under one or more Operation , satisfying some axiom....
s explicitly require their binary operations to be associative. However, many important and interesting operations are non-associative; one common example would be the vector cross product.

Definition


Formally, a binary operation on a set S is called associative if it satisfies the associative law:

Using * to denote a binary operation
Binary operation

In mathematics, a binary operation is a calculation involving two operands, in other words, an operation whose arity is two. Binary operations can be accomplished using either a binary function or binary operator....
 performed on a set


An example of multiplicative associativity


The evaluation order does not affect the value of such expressions, and it can be shown that the same holds for expressions containing
any number of operations. Thus, when is associative, the evaluation order can therefore be left unspecified without causing ambiguity, by omitting the parentheses and writing simply:



However, it is important to remember that changing the order of operations does not involve or permit changing the actual operations themselves by moving the operands around within the expression.

A very different perspective is obtained by rephrasing associativity using functional notation: : when expressed in this form, associativity becomes less obvious.

Examples


Some examples of associative operations include the following.

  • In arithmetic
    Arithmetic

    Arithmetic or arithmetics is the oldest and most elementary branch of mathematics, used by almost everyone, for tasks ranging from simple day-to-day counting to advanced science and business calculations....
    , addition
    Addition

    Addition is the mathematics process of putting things together. The plus sign "+" means that numbers are added together. For example, in the picture on the right, there are 3 + 2 apples?meaning three apples and two other apples?which is the same as five apples, since 3 + 2 = 5....
     and multiplication
    Multiplication

    Multiplication is the Operation of scaling one number by another. It is one of the four basic operations in elementary arithmetic .Multiplication is defined for Natural number in terms of repeated addition; for example, 4 multiplied by 3 can be calculated by adding 3 copies of 4 together:...
     of real number
    Real number

    In mathematics, the real numbers may be described informally in several different ways. The real numbers include both rational numbers, such as 42 and −23/129, and irrational numbers, such as pi and the square root of two; or, a real number can be given by an infinite decimal representation, such as 2.4871773339...., where the digits co...
    s are associative; i.e.,


  • Addition and multiplication of complex number
    Complex number

    In mathematics, the complex numbers are an extension of the real numbers obtained by adjoining an imaginary unit, denoted i, which satisfies:...
    s and quaternion
    Quaternion

    Quaternions, in mathematics, are a non-commutative number system that extends the complex numbers. The quaternions were first described by Irish mathematician Sir William Rowan Hamilton in 1843 and applied to mechanics in three-dimensional space....
    s is associative. Addition of octonion
    Octonion

    In mathematics, the octonions are a associative extension of the quaternions. Their 8-dimensional normed division algebra over the real numbers is the widest possible that can be obtained from the Cayley-Dickson construction....
    s is also associative, but multiplication of octonions is non-associative.


  • The greatest common divisor
    Greatest common divisor

    In mathematics, the greatest common divisor , sometimes known as the greatest common factor or highest common factor , of two non-zero integers, is the largest positive integer that divisor both numbers without remainder....
     and least common multiple
    Least common multiple

    In arithmetic and number theory, the least common multiple or lowest common multiple or smallest common multiple of two integers a and b is the smallest positive integer that is a multiple both of a and of b....
     functions act associatively.


  • Because linear transformation
    Linear transformation

    In mathematics, a linear map is a function between two vector spaces that preserves the operations of vector addition and scalar multiplication....
    s are functions that can be represented by matrices with matrix multiplication
    Matrix multiplication

    In mathematics, matrix multiplication is the operation of multiplying a matrix with either a scalar or another matrix. This article gives an overview of the various ways to perform matrix multiplication....
     being the representation of functional composition, one can immediately conclude that matrix multiplication is associative.


  • Taking the intersection
    Intersection (set theory)

    In mathematics, the intersection of two Set A and B is the set that contains all elements of A that also belong to B , but no other elements....
     or the union
    Union (set theory)

    In set theory, the term Union refers to a set operation used in the convergence of set elements to form a resultant set containing the elements of both sets....
     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.

Non-associativity


A binary operation on a set
S that does not satisfy the associative law is called non-associative. Symbolically,



For such an operation the order of evaluation
does matter. Subtraction
Subtraction

Subtraction is one of the four basic arithmetic operations; it is the inverse of addition, meaning that if we start with any number and add any number and then subtract the same number we added, we return to the number we started with....
, division
Division (mathematics)

In mathematics, especially in elementary arithmetic, division is an arithmetic operation which is the inverse of multiplication.Specifically, if c times b equals a, written:...
 and exponentiation
Exponentiation

Exponentiation is a mathematics operation , written 'an', involving two numbers, the base a and the exponent n....
 are well-known examples of non-associative operations:

In general, parentheses must be used to indicate the order of evaluation
Order of operations

In algebra and computer programming, when a number or expression is both preceded and followed by an operator such as minus or multiplication, a rule is needed to specify which operator should be applied first; this rule is known as a precedence rule, or more informally order of operation....
 if a non-associative operation appears more than once in an expression. However, mathematician
Mathematician

A mathematician is a person whose primary area of study and/or research is the field of mathematics....
s agree on a particular order of evaluation for several common non-associative operations. This is simply a syntactical convention to avoid parentheses.

A left-associative operation is a non-associative operation that is conventionally evaluated from left to right, i.e.,

while a right-associative operation is conventionally evaluated from right to left:

Both left-associative and right-associative operations occur; examples are given below.

More examples


Left-associative operations include the following.

  • Subtraction and division of real numbers:


Right-associative operations include the following.

  • Exponentiation
    Exponentiation

    Exponentiation is a mathematics operation , written 'an', involving two numbers, the base a and the exponent n....
     of real numbers:


The reason exponentiation is right-associative is that a repeated left-associative exponentiation operation would be less useful. Multiple appearances could (and would) be rewritten with multiplication:




Non-associative operations for which no conventional evaluation order is defined include the following.

  • Taking the pairwise average
    Average

    In mathematics, an average, or central tendency of a data set refers to a measure of the "middle" or "Expected value" value of the data set....
     of real numbers:
  • Taking the relative complement
    Complement (set theory)

    In discrete mathematics and predominantly in set theory, a complement is a concept used in comparisons of sets to refer to the unique values of one set in relation to another....
     of sets:




The green part in the left Venn diagram
Venn diagram

Venn diagrams or set diagrams are diagrams that show all hypothetically possible logical relations between a finite collection of Set . Venn diagrams were invented around 1880 by John Venn....
 represents . The green part in the right Venn diagram
Venn diagram

Venn diagrams or set diagrams are diagrams that show all hypothetically possible logical relations between a finite collection of Set . Venn diagrams were invented around 1880 by John Venn....
 represents .




See also


  • A semigroup
    Semigroup

    In mathematics, a semigroup is an algebraic structure consisting of a nonempty Set S together with an associative binary operation. In other words, a semigroup is an associative Magma ....
     is a set with a closed associative binary operation.
  • Commutativity
    Commutativity

    In mathematics, commutativity is the process to change the order of something without changing the end result. It is a fundamental property of many binary operations throughout mathematics, and many Mathematical proof depend on it....
     and distributivity
    Distributivity

    In mathematics, and in particular in abstract algebra, distributivity is a property of binary operations that generalises the distributive law from elementary algebra....
     are two other frequently discussed properties of binary operations.
  • Power associativity
    Power associativity

    In abstract algebra, power associativity is a weak form of associativity.An algebra over a field is said to be power-associative if the subalgebra generated by any element is associative....
     and alternativity
    Alternativity

    In abstract algebra, a magma G is said to be left alternative if y=x for all x and y in G and right alternative if y=x for all x and y in G....
     are weak forms of associativity.