Iverson bracket

From testwiki
Jump to navigation Jump to search

Template:Short description 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 Template:Math. It maps any statement to a function of the free variables 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: [P]={1if P is true;0otherwise. 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 without restriction on the summation index. That is, for any property P(k) of the integer k, one can rewrite the restricted sum k:P(k)f(k) in the unrestricted form kf(k)[P(k)]. With this convention, f(k) does not need to be defined for the values of Template:Mvar for which the Iverson bracket equals Template:Math; that is, a summand f(k)[false] 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,[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]

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(k1,) any property of integers; then we have [][PQ]=[P][Q];[PQ]=[P]+[Q][P][Q];[¬P]=1[P];[P XOR Q]=|[P][Q]|;[kA]+[kB]=[kAB]+[kAB];[xAB]=[xA][xB];[m :P(k,m)]=m[P(k,m)];[m :P(k,m)]=min{1,m[P(k,m)]}=1m[¬P(k,m)];#{m|P(k,m)}=m[P(k,m)].

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: kAf(k)+kBf(k)=kf(k)[kA]+kf(k)[kB]=kf(k)([kA]+[kB])=kf(k)([kAB]+[kAB])=kABf(k) +kABf(k).

Summation interchange

The well-known rule j=1nk=1jf(j,k)=k=1nj=knf(j,k) is likewise easily derived: j=1nk=1jf(j,k)=j,kf(j,k)[1jn][1kj]=j,kf(j,k)[1kjn]=j,kf(j,k)[1kn][kjn]=k=1nj=knf(j,k).

Counting

For instance, Euler's totient function that counts the number of positive integers up to n which are coprime to n can be expressed by φ(n)=i=1n[gcd(i,n)=1],for n+.

Simplification of special cases

Another use of the Iverson bracket is to simplify equations with special cases. For example, the formula 1kngcd(k,n)=1k=12nφ(n)

is valid for Template:Math but is off by Template:Sfrac for Template:Math. To get an identity valid for all positive integers Template:Mvar (i.e., all values for which φ(n) is defined), a correction term involving the Iverson bracket may be added: 1kngcd(k,n)=1k=12n(φ(n)+[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 notation is a specific case of Iverson notation when the condition is equality. That is, δij=[i=j].

The indicator function of a set A, often denoted 𝟏A(x), 𝐈A(x) or χA(x), is an Iverson bracket with set membership as its condition: 𝐈A(x)=[xA].

The Heaviside step function, sign function,[1] and absolute value function are also easily expressed in this notation: H(x)=[x0],sgn(x)=[x>0][x<0],

and |x|=x[x>0]x[x<0]=x([x>0][x<0])=xsgn(x).

The comparison functions max and min (returning the larger or smaller of two arguments) may be written as max(x,y)=x[x>y]+y[xy] and min(x,y)=x[xy]+y[x>y].

The floor and ceiling functions can be expressed as x=nn[nx<n+1] and x=nn[n1<xn], where the index n of summation is understood to range over all the integers.

The ramp function can be expressed R(x)=x[x0].

The trichotomy of the reals is equivalent to the following identity: [a<b]+[a=b]+[a>b]=1.

The Möbius function has the property (and can be defined by recurrence as[4]) d|nμ(d) = [n=1].

Formulation in terms of usual functions

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

Notational variations

In addition to the now-standard square brackets Template:Nobr and the original parentheses Template:Nobr blackboard bold brackets have also been used, e.g. Template:Nobr as well as other unusual forms of bracketing marks available in the publisher's typeface, accompanied by a marginal note.

See also

References

Template:Reflist

  1. 1.0 1.1 Template:Cite book
  2. Ronald Graham, Donald Knuth, and Oren Patashnik. Concrete Mathematics, Section 2.1: Notation.
  3. 3.0 3.1 Donald Knuth, "Two Notes on Notation", American Mathematical Monthly, Volume 99, Number 5, May 1992, pp. 403–422. (TeX Template:Webarchive, Template:Arxiv).
  4. Ronald Graham, Donald Knuth, and Oren Patashnik. Concrete Mathematics, Section 4.9: Phi and Mu.