Iverson's Convention
   HOME

TheInfoList



OR:

In mathematics, 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 Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-oriente ...
of the
free variable In mathematics, and in other disciplines involving formal languages, including mathematical logic and computer science, a free variable is a notation (symbol) that specifies places in an expression where substitution may take place and is not ...
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 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 any kind 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, ma ...
without summation index. That is, for any property P(k) of the integer k, \sum_kf(k)\, (k)= \sum_f(k). By 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. Likewise for
products Product may refer to: Business * Product (business), an item that serves as a solution to a specific consumer problem. * Product (project management), a deliverable or set of deliverables that contribute to a business solution Mathematics * Produ ...
: \prod_kf(k)^ = \prod_f(k). 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, mathematician, and professor emeritus at Stanford University. He is the 1974 recipient of the ACM Turing Award, informally considered the Nobel Prize of computer sc ...
to avoid ambiguity in parenthesized logical expressions.Donald Knuth, "Two Notes on Notation", '' American Mathematical Monthly'', 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, the Euler phi function that counts the number of positive integers up to ''n'' which are
coprime In mathematics, 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 equivale ...
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 \phi(n) is defined), a correction term involving the Iverson bracket may be added: \sum_\!\!k = \fracn(\varphi(n)+ =1


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, 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 (1850–1925), the value of which is zero for negative arguments and one for positive argum ...
, sign function, and absolute value function are also easily expressed in this notation: \begin H(x) &= > 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 In mathematics and computer science, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least int ...
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 o ...
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 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 most of ...
has the property (and can be defined by recurrence as
Ronald Graham Ronald Lewis Graham (October 31, 1935July 6, 2020) was an American mathematician credited by the American Mathematical Society as "one of the principal architects of the rapid development worldwide of discrete mathematics in recent years". He ...
,
Donald Knuth Donald Ervin Knuth ( ; born January 10, 1938) is an American computer scientist, mathematician, and professor emeritus at Stanford University. He is the 1974 recipient of the ACM Turing Award, informally considered the Nobel Prize of computer sc ...
, and
Oren Patashnik Oren Patashnik (born 1954) is an American computer scientist. He is notable for co-creating BibTeX, and co-writing '' Concrete Mathematics: A Foundation for Computer Science''. He is a researcher at the Center for Communications Research, La Jol ...
. ''
Concrete Mathematics ''Concrete Mathematics: A Foundation for Computer Science'', by Ronald Graham, Donald Knuth, and Oren Patashnik, first published in 1989, is a textbook that is widely used in computer-science departments as a substantive but light-hearted treatme ...
'', 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, 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 wiggly 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 function ...
*
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 valu ...
in computer programming: many languages allow numeric or pointer quantities to be used as boolean quantities * Indicator function


References

{{reflist Mathematical notation