KNOWPIA
WELCOME TO KNOWPIA

In mathematics, the **Iverson bracket**, named after Kenneth E. Iverson, is a notation that
generalises the Kronecker delta, which is the Iverson bracket of the statement *x* = *y*. It maps any statement to a function of the free variables in it that takes the value one for the values of the variables for which the statement is true, and takes the value zero otherwise. It is generally denoted by putting the statement inside square brackets:

In the context of summation, the notation can be used to write any sum as an infinite sum without limits: If is any property of the integer ,

Note that by this convention, a summand must evaluate to 0 regardless of whether is defined. Likewise for products:

The notation was originally introduced by Kenneth E. Iverson in his programming language APL,^{[1]}^{[2]} 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 to avoid ambiguity in parenthesized logical expressions.^{[3]}

There is a direct correspondence between arithmetic on Iverson brackets, logic, and set operations. For instance, let *A* and *B* be sets and any property of integers; then we have

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.

We mechanically derive a well-known sum manipulation rule using Iverson brackets:

The well-known rule is likewise easily derived:

For instance, the Euler phi function that counts the number of positive integers up to *n* which are coprime to *n* can be expressed by

Another use of the Iverson bracket is to simplify equations with special cases. For example, the formula

is valid for *n* > 1 but is off by 1/2 for *n* = 1. To get an identity valid for all positive integers *n* (i.e., all values for which is defined), a correction term involving the Iverson bracket may be added:

Many common functions, especially those with a natural piecewise definition, may be expressed in terms of the Iverson bracket. The Kronecker delta notation is a specific case of Iverson notation when the condition is equality. That is,

The indicator function, often denoted , or , is an Iverson bracket with set membership as its condition:

- .

The Heaviside step function, sign function,^{[1]} and absolute value function are also easily expressed in this notation:

and

The comparison functions max and min (returning the larger or smaller of two arguments) may be written as

- and
- .

The floor and ceiling functions can be expressed as

and

where the index of summation is understood to range over all the integers.

The ramp function can be expressed

The trichotomy of the reals is equivalent to the following identity:

The Möbius function has the property (and can be defined by recurrence as^{[4]})

In the 1830s, Guglielmo dalla Sommaja used the expression to represent what now would be written ; dalla Sommaja also used variants, such as for .^{[3]}
Following one common convention, those quantities are equal where defined: is 1 if x > 0, is 0 if x = 0, and is undefined otherwise.

- Boolean function
- Type conversion in computer programming: many languages allow numeric or pointer quantities to be used as boolean quantities
- Indicator function

- ^
^{a}^{b}Kenneth E. Iverson (1962).*A Programming Language*. Wiley. p. 11. Retrieved 7 April 2016. **^**Ronald Graham, Donald Knuth, and Oren Patashnik.*Concrete Mathematics*, Section 2.2: Sums and Recurrences.- ^
^{a}^{b}Donald Knuth, "Two Notes on Notation",*American Mathematical Monthly*, Volume 99, Number 5, May 1992, pp. 403–422. (TeX, arXiv:math/9205211). **^**Ronald Graham, Donald Knuth, and Oren Patashnik.*Concrete Mathematics*, Section 4.9: Phi and Mu.