Iverson bracket

From formulasearchengine
Revision as of 05:05, 3 June 2014 by en>InverseHypercube (→‎Uses)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

In mathematics, the Iverson bracket, named after Kenneth E. Iverson, is a notation that denotes a number that is 1 if the condition in square brackets is satisfied, and 0 otherwise. More exactly,

where P is a statement that can be true or false. This notation was introduced by Kenneth E. Iverson in his programming language APL,[1] while the specific restriction to square brackets was advocated by Donald Knuth to avoid ambiguity in parenthesized logical expressions.[2]


The Iverson bracket converts a Boolean value to an integer value through the natural map , which allows counting to be represented as summation. 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

More generally 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. For example,

In the first sum, the index is limited to be in the range 1 to 10. The second sum is allowed to range over all integers, but where i is strictly less than 1 or strictly greater than 10, the summand is 0, contributing nothing to the sum. Such use of the Iverson bracket can permit easier manipulation of these expressions.

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

which is valid for n > 1 but which is off by {{ safesubst:#invoke:Unsubst||$B=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:

Special cases

The Kronecker delta notation is a specific case of Iverson notation when the condition is equality. That is,

The indicator function, another specific case, has set membership as its condition:

The sign function and Heaviside step function are also easily expressed in this notation:

The floor and ceiling functions can be expressed:

And the trichotomy of the reals can be expressed:

The Macaulay brackets can be expressed

See also


  1. Ronald Graham, Donald Knuth, and Oren Patashnik. Concrete Mathematics, Section 2.2: Sums and Recurrences.
  2. Knuth 1992.