{{short description|Repeated application of an operation to a sequence}} In mathematics, an '''iterated binary operation''' is an extension of a binary operation on a set ''S'' to a function on finite sequences of elements of ''S'' through repeated application.<ref name=IBO1>{{cite book|title=Categories for the Working Mathematician |author= Saunders MacLane|author-link=Saunders Mac Lane |page=142 |location=New York |publisher= Springer-Verlag |date= 1971 |isbn=0387900357}}</ref> Common examples include the extension of the addition operation to the summation operation, and the extension of the multiplication operation to the product operation. Other operations, e.g., the set-theoretic operations union and intersection, are also often iterated, but the iterations are not given separate names. In print, summation and product are represented by special symbols; but other iterated operators often are denoted by larger variants of the symbol for the ordinary binary operator. Thus, the iterations of the four operations mentioned above are denoted :<math>\sum,\ \prod,\ \bigcup,</math> and <math>\bigcap</math>, respectively.
More generally, iteration of a binary function is generally denoted by a slash: iteration of <math>f</math> over the sequence <math>(a_{1}, a_{2} \ldots, a_{n})</math> is denoted by <math>f / (a_{1}, a_{2} \ldots, a_{n})</math>, following the notation for reduce in Bird–Meertens formalism.
In general, there is more than one way to extend a binary operation to operate on finite sequences, depending on whether the operator is associative, and whether the operator has identity elements.
== Definition ==
Denote by '''a'''<sub>''j'',''k''</sub>, with {{nowrap|''j'' ≥ 0}} and {{nowrap|''k'' ≥ ''j''}}, the finite sequence of length {{nowrap|''k'' − ''j''}} of elements of ''S'', with members (''a''<sub>i</sub>), for {{nowrap|''j'' ≤ ''i'' < ''k''}}. Note that if {{nowrap|1=''k'' = ''j''}}, the sequence is empty.
For {{nowrap|''f'' : ''S'' × ''S'' → ''S''}}, define a new function ''F''<sub>''l''</sub> on finite nonempty sequences of elements of ''S'', where <math display="block">F_l(\mathbf{a}_{0,k})= \begin{cases} a_0, &k=1\\ f(F_l(\mathbf{a}_{0,k-1}), a_{k-1}), &k>1. \end{cases}</math>
Similarly, define <math display="block">F_r(\mathbf{a}_{0,k}) = \begin{cases} a_0, &k=1\\ f(a_0, F_r(\mathbf{a}_{1,k})), &k>1. \end{cases}</math>
If ''f'' has a unique left identity ''e'', the definition of ''F''<sub>''l''</sub> can be modified to operate on empty sequences by defining the value of ''F''<sub>''l''</sub> on an empty sequence to be ''e'' (the previous base case on sequences of length 1 becomes redundant). Similarly, ''F''<sub>''r''</sub> can be modified to operate on empty sequences if ''f'' has a unique right identity.
If ''f'' is associative, then ''F''<sub>''l''</sub> equals ''F''<sub>''r''</sub>, and we can simply write ''F''. Moreover, if an identity element ''e'' exists, then it is unique (see Monoid).
If ''f'' is commutative and associative, then ''F'' can operate on any non-empty finite multiset by applying it to an arbitrary enumeration of the multiset. If ''f'' moreover has an identity element ''e'', then this is defined to be the value of ''F'' on an empty multiset. If ''f'' is idempotent, then the above definitions can be extended to finite sets.
If ''S'' also is equipped with a metric or more generally with topology that is Hausdorff, so that the concept of a limit of a sequence is defined in ''S'', then an ''infinite iteration'' on a countable sequence in ''S'' is defined exactly when the corresponding sequence of finite iterations converges. Thus, e.g., if ''a''<sub>0</sub>, ''a''<sub>1</sub>, ''a''<sub>2</sub>, ''a''<sub>3</sub>, … is an infinite sequence of real numbers, then the infinite product <math display="inline">\prod_{i=0}^\infty a_i</math> is defined, and equal to <math display="inline">\lim\limits_{n\to\infty}\prod_{i=0}^na_i,</math> if and only if that limit exists.
==Non-associative binary operation== The general, non-associative binary operation is given by a magma. The act of iterating on a non-associative binary operation may be represented as a binary tree.
==Notation==
Iterated binary operations are used to represent an operation that will be repeated over a set subject to some constraints. Typically the lower bound of a restriction is written under the symbol, and the upper bound over the symbol, though they may also be written as superscripts and subscripts in compact notation. Interpolation is performed over positive integers from the lower to upper bound, to produce the set which will be substituted into the index (below denoted as ''i''{{space|hair}}) for the repeated operations.
Common notations include the big sigma (repeated sum) and big pi (repeated product) notations.
<math display="block">\sum_{i=0}^{n-1} i = 0+1+2+ \dots + (n-1)</math> <math display="block">\prod_{i=0}^{n-1} i = 0 \times 1 \times 2 \times \dots \times (n-1)</math>
It is possible to specify set membership or other logical constraints in place of explicit indices, in order to implicitly specify which elements of a set shall be used:
<math display="block">\sum_{x \in S} x = x_1 + x_2 + x_3 + \dots + x_n</math>
Multiple conditions may be written either joined with a logical and or separately:
<math display="block">\sum_{(i \in 2\N) \wedge (i \leq n)} i = \sum_{\stackrel{i \in 2\N}{i \leq n }} i = 0 + 2 + 4 + \dots + n</math>
Less commonly, any binary operator such as exclusive or {{nowrap|(<math>\oplus</math>)}} or set union {{nowrap|(<math>\cup</math>)}} may also be used.<ref>{{MathWorld|title=Union|id=Union|access-date=30 January 2018}}</ref> For example, if ''S'' is a set of logical propositions:
<math display="block">\bigwedge_{p \in S} p = p_1 \wedge p_2 \wedge \dots \wedge p_N</math>
which is true iff all of the elements of ''S'' are true.
== See also ==
* Unary operation * Unary function * Binary operation * Binary function * Ternary operation
== References == <references /> ==External links== * [https://web.archive.org/web/20071009181156/http://www.short-fuze.co.uk/~eddy/math/associate.html Bulk action] <!-- archived from the original --> * [http://wotug.ukc.ac.uk/parallel/acronyms/hpccgloss/P.html#parallel%20prefix Parallel prefix operation] {{Webarchive|url=https://web.archive.org/web/20130603182033/http://wotug.ukc.ac.uk/parallel/acronyms/hpccgloss/P.html#parallel%20prefix |date=2013-06-03 }} * [https://www.cs.cornell.edu/Info/People/sfa/Nuprl/iterated_binops/Xiter_via_intseg_remark_INTRO.html Nuprl iterated binary operations]{{Webarchive|url=https://web.archive.org/web/20160303191406/https://www.cs.cornell.edu/Info/People/sfa/Nuprl/iterated_binops/Xiter_via_intseg_remark_INTRO.html|date=2016-03-03}} Category:Binary operations