Iverson Bracket
   HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, the Iverson bracket, named after Kenneth E. Iverson, is a notation that generalises the
Kronecker delta In mathematics, the Kronecker delta (named after Leopold Kronecker) is a function of two variables, usually just non-negative integers. The function is 1 if the variables are equal, and 0 otherwise: \delta_ = \begin 0 &\text i \neq j, \\ 1 &\ ...
, which is the Iverson bracket of the statement . It maps any statement to a function of the
free variable In mathematics, and in other disciplines involving formal languages, including mathematical logic and computer science, a variable may be said to be either free or bound. Some older books use the terms real variable and apparent variable for f ...
s in that statement. This function is defined to take the value 1 for the values of the variables for which the statement is true, and takes the value 0 otherwise. It is generally denoted by putting the statement inside square brackets: = \begin 1 & \text P \text \\ 0 & \text \end In other words, the Iverson bracket of a statement is the
indicator function In mathematics, an indicator function or a characteristic function of a subset of a set is a function that maps elements of the subset to one, and all other elements to zero. That is, if is a subset of some set , then the indicator functio ...
of the set of values for which the statement is true. The Iverson bracket allows using
capital-sigma notation In mathematics, summation is the addition of a sequence of numbers, called ''addends'' or ''summands''; the result is their ''sum'' or ''total''. Beside numbers, other types of values can be summed as well: functions, vectors, matrices, polyn ...
without restriction on the summation index. That is, for any property P(k) of the integer k, one can rewrite the restricted sum \sum_f(k) in the unrestricted form \sum_k f(k) \cdot (k)/math>. With this convention, f(k) does not need to be defined for the values of for which the Iverson bracket equals ; that is, a summand f(k) textbf/math> must evaluate to 0 regardless of whether f(k) is defined. The notation was originally introduced by Kenneth E. Iverson in his programming language APL, though restricted to single relational operators enclosed in parentheses, while the generalisation to arbitrary statements, notational restriction to square brackets, and applications to summation, was advocated by
Donald Knuth Donald Ervin Knuth ( ; born January 10, 1938) is an American computer scientist and mathematician. He is a professor emeritus at Stanford University. He is the 1974 recipient of the ACM Turing Award, informally considered the Nobel Prize of comp ...
to avoid ambiguity in parenthesized logical expressions.Donald Knuth, "Two Notes on Notation", ''
American Mathematical Monthly ''The American Mathematical Monthly'' is a peer-reviewed scientific journal of mathematics. It was established by Benjamin Finkel in 1894 and is published by Taylor & Francis on behalf of the Mathematical Association of America. It is an exposi ...
'', Volume 99, Number 5, May 1992, pp. 403–422.
TeX
, ).


Properties

There is a direct correspondence between arithmetic on Iverson brackets, logic, and set operations. For instance, let ''A'' and ''B'' be sets and P(k_1,\dots) any property of integers; then we have \begin[] [\,P \land Q\,] ~ &= ~ [\,P\,]\,[\,Q\,]~~; \\ em [\,P \lor Q\,] ~ &= ~ ,P\,\; + \; ,Q\,\; - \; [\,P\,]\,[\,Q\,]~~; \\ em ,\neg \,P\,~ &= ~ 1 - ,P\,~; \\ em ,P Q\,~ &= ~ \Bigl, \, ,P\,\; - \; ,Q\,\, \Bigr, ~~; \\ em ,k \in A\,\; + \; ,k \in B\,~ &= ~ ,k \in A \cup B\,\; + \; ,k \in A \cap B\,~; \\ em ,x \in A \cap B\,~ &= ~ ,x \in A\,, ,x \in B\,~; \\ em ,\forall \,m\ : \, P(k, m)\,~ &= ~ \prod_m\, ,P(k, m)\,~; \\ em ,\exists \,m\ : \, P(k, m)\,~ &= ~ \min\Bigl\ = 1 \; - \;\prod_m \, ,\neg\, P(k, m)\,~~; \\ em\#\Bigl\ ~ &= ~ \sum_m \, ,P(k, m)\,~. \end


Examples

The notation allows moving boundary conditions of summations (or integrals) as a separate factor into the summand, freeing up space around the summation operator, but more importantly allowing it to be manipulated algebraically.


Double-counting rule

We mechanically derive a well-known sum manipulation rule using Iverson brackets: \begin \sum_f(k)+\sum_f(k) &=\sum_kf(k)\, \in A\sum_kf(k)\, \in B\ &=\sum_kf(k)\,( \in A \in B \\&=\sum_kf(k)\,( \in A\cup B \in A\cap B \\&=\sum_f(k)\ +\sum_f(k). \end


Summation interchange

The well-known rule \sum_^n \sum_^j f(j,k) = \sum_^n \sum_^n f(j,k) is likewise easily derived: \begin \sum_^n\,\sum_^j f(j,k) &=\sum_f(j,k)\, \leq j\leq n, \leq k\leq j\\&=\sum_f(j,k)\, \leq k\leq j\leq n\\&=\sum_f(j,k)\, \leq k\leq n, \leq j\leq n \\&=\sum_^n\,\sum_^n f(j,k). \end


Counting

For instance,
Euler's totient function In number theory, Euler's totient function counts the positive integers up to a given integer that are relatively prime to . It is written using the Greek letter phi as \varphi(n) or \phi(n), and may also be called Euler's phi function. In ot ...
that counts the number of positive integers up to ''n'' which are
coprime In number theory, two integers and are coprime, relatively prime or mutually prime if the only positive integer that is a divisor of both of them is 1. Consequently, any prime number that divides does not divide , and vice versa. This is equiv ...
to ''n'' can be expressed by \varphi(n)=\sum_^ gcd(i,n)=1\qquad\text n\in\N^+.


Simplification of special cases

Another use of the Iverson bracket is to simplify equations with special cases. For example, the formula \sum_\!\!k = \fracn\varphi(n) is valid for but is off by for . To get an identity valid for all positive integers (i.e., all values for which \varphi(n) is defined), a correction term involving the Iverson bracket may be added: \sum_\!\!k = \fracn \Big(\varphi(n)+ =1Big)


Common functions

Many common functions, especially those with a natural piecewise definition, may be expressed in terms of the Iverson bracket. The
Kronecker delta In mathematics, the Kronecker delta (named after Leopold Kronecker) is a function of two variables, usually just non-negative integers. The function is 1 if the variables are equal, and 0 otherwise: \delta_ = \begin 0 &\text i \neq j, \\ 1 &\ ...
notation is a specific case of Iverson notation when the condition is equality. That is, \delta_ = =j The
indicator function In mathematics, an indicator function or a characteristic function of a subset of a set is a function that maps elements of the subset to one, and all other elements to zero. That is, if is a subset of some set , then the indicator functio ...
of a set A, often denoted \mathbf_A(x), \mathbf_A(x) or \chi_A(x), is an Iverson bracket with set membership as its condition: \mathbf_A(x) = \in A The
Heaviside step function The Heaviside step function, or the unit step function, usually denoted by or (but sometimes , or ), is a step function named after Oliver Heaviside, the value of which is zero for negative arguments and one for positive arguments. Differen ...
,
sign function In mathematics, the sign function or signum function (from '' signum'', Latin for "sign") is a function that has the value , or according to whether the sign of a given real number is positive or negative, or the given number is itself zer ...
, and absolute value function are also easily expressed in this notation: \begin H(x) &= \ge 0 \\ \sgn(x) &= > 0- < 0 \end and \begin , x, &= x > 0- x < 0\\ &= x( > 0- < 0 \\ &= x \cdot \sgn(x). \end The comparison functions max and min (returning the larger or smaller of two arguments) may be written as \max(x, y) = x > y+ y \leq y/math> and \min(x, y) = x \leq y+ y > y The floor and ceiling functions can be expressed as \lfloor x \rfloor = \sum_n n \cdot \le x < n + 1/math> and \lceil x \rceil = \sum_n n \cdot - 1 < x \le n where the index n of summation is understood to range over all the integers. The
ramp function The ramp function is a unary real function, whose graph is shaped like a ramp. It can be expressed by numerous definitions, for example "0 for negative inputs, output equals input for non-negative inputs". The term "ramp" can also be used for ...
can be expressed R(x) = x \cdot \geq 0 The trichotomy of the reals is equivalent to the following identity: < b+ = b+ > b= 1. The
Möbius function The Möbius function \mu(n) is a multiplicative function in number theory introduced by the German mathematician August Ferdinand Möbius (also transliterated ''Moebius'') in 1832. It is ubiquitous in elementary and analytic number theory and m ...
has the property (and can be defined by recurrence as Ronald Graham,
Donald Knuth Donald Ervin Knuth ( ; born January 10, 1938) is an American computer scientist and mathematician. He is a professor emeritus at Stanford University. He is the 1974 recipient of the ACM Turing Award, informally considered the Nobel Prize of comp ...
, and Oren Patashnik. '' Concrete Mathematics'', Section 4.9: Phi and Mu.
) \sum_ \mu(d) \ =\ =1


Formulation in terms of usual functions

In the 1830s, Guglielmo dalla Sommaja used the expression 0^ to represent what now would be written > 0/math>; he also used variants, such as \left(1 - 0^\right) \left(1 - 0^\right) for \leq x \leq a/math>. Following one common convention (that 0^0=1), those quantities are equal where defined: 0^ is 1 if , is 0 if , and is undefined otherwise.


Notational variations

In addition to the now-standard square brackets and the original parentheses
blackboard bold Blackboard bold is a style of writing Emphasis (typography), bold symbols on a blackboard by doubling certain strokes, commonly used in mathematical lectures, and the derived style of typeface used in printed mathematical texts. The style is most ...
brackets have also been used, e.g. as well as other unusual forms of bracketing marks available in the publisher's typeface, accompanied by a marginal note.


See also

*
Boolean function In mathematics, a Boolean function is a function whose arguments and result assume values from a two-element set (usually , or ). Alternative names are switching function, used especially in older computer science literature, and truth functi ...
*
Type conversion In computer science, type conversion, type casting, type coercion, and type juggling are different ways of changing an expression from one data type to another. An example would be the conversion of an integer value into a floating point val ...
in computer programming: many
languages Language is a structured system of communication that consists of grammar and vocabulary. It is the primary means by which humans convey meaning, both in spoken and signed forms, and may also be conveyed through writing. Human language is ch ...
allow numeric or pointer quantities to be used as boolean quantities *
Indicator function In mathematics, an indicator function or a characteristic function of a subset of a set is a function that maps elements of the subset to one, and all other elements to zero. That is, if is a subset of some set , then the indicator functio ...


References

{{reflist Mathematical notation