HOME

TheInfoList



OR:

In
mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern 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 (or logical function), used in logic. Boolean functions are the subject of Boolean algebra and switching theory. A Boolean function takes the form f:\^k \to \, where \ is known as the Boolean domain and k is a non-negative integer called the
arity Arity () is the number of arguments or operands taken by a function, operation or relation in logic, mathematics, and computer science. In mathematics, arity may also be named ''rank'', but this word can have many other meanings in mathematics. In ...
of the function. In the case where k=0, the function is a constant element of \. A Boolean function with multiple outputs, f:\^k \to \^m with m>1 is a ''vectorial'' or ''vector-valued'' Boolean function (an S-box in symmetric cryptography). There are 2^ different Boolean functions with k arguments; equal to the number of different truth tables with 2^k entries. Every k-ary Boolean function can be expressed as a propositional formula in k variables x_1,...,x_k, and two propositional formulas are logically equivalent if and only if they express the same Boolean function.


Examples

The rudimentary symmetric Boolean functions ( logical connectives or logic gates) are: * NOT,
negation In logic, negation, also called the logical complement, is an operation that takes a proposition P to another proposition "not P", written \neg P, \mathord P or \overline. It is interpreted intuitively as being true when P is false, and false ...
or complement - which receives one input and returns true when that input is false ("not") * AND or conjunction - true when all inputs are true ("both") * OR or disjunction - true when any input is true ("either") *
XOR Exclusive or or exclusive disjunction is a logical operation that is true if and only if its arguments differ (one is true, the other is false). It is symbolized by the prefix operator J and by the infix operators XOR ( or ), EOR, EXOR, , ...
or
exclusive disjunction Exclusive or or exclusive disjunction is a logical operation that is true if and only if its arguments differ (one is true, the other is false). It is symbolized by the prefix operator J and by the infix operators XOR ( or ), EOR, EXOR, , , ...
- true when one of its inputs is true and the other is false ("not equal") * NAND or Sheffer stroke - true when it is not the case that all inputs are true ("not both") * NOR or logical nor - true when none of the inputs are true ("neither") * XNOR or logical equality - true when both inputs are the same ("equal") An example of a more complicated function is the majority function (of an odd number of inputs).


Representation

A Boolean function may be specified in a variety of ways: * Truth table: explicitly listing its value for all possible values of the arguments **Marquand diagram: truth table values arranged in a two-dimensional grid (used in a Karnaugh map) ** Binary decision diagram, listing the truth table values at the bottom of a binary tree ** Venn diagram, depicting the truth table values as a colouring of regions of the plane Algebraically, as a propositional formula using rudimentary boolean functions: * Negation normal form, an arbitrary mix of AND and ORs of the arguments and their complements * Disjunctive normal form, as an OR of ANDs of the arguments and their complements * Conjunctive normal form, as an AND of ORs of the arguments and their complements * Canonical normal form, a standardized formula which uniquely identifies the function: **
Algebraic normal form In Boolean algebra, the algebraic normal form (ANF), ring sum normal form (RSNF or RNF), '' Zhegalkin normal form'', or '' Reed–Muller expansion'' is a way of writing logical formulas in one of three subforms: * The entire formula is purely tr ...
or
Zhegalkin polynomial Zhegalkin (also Žegalkin, Gégalkine or Shegalkin) polynomials (russian: полиномы Жегалкина), also known as algebraic normal form, are a representation of functions in Boolean algebra. Introduced by the Russian mathematician Iva ...
, as a XOR of ANDs of the arguments (no complements allowed) **''Full'' (canonical) disjunctive normal form, an OR of ANDs each containing every argument or complement (
minterms In Boolean algebra, any Boolean function can be expressed in the canonical disjunctive normal form ( CDNF) or minterm canonical form and its dual canonical conjunctive normal form ( CCNF) or maxterm canonical form. Other canonical forms include ...
) **''Full'' (canonical) conjunctive normal form, an AND of ORs each containing every argument or complement (
maxterms In Boolean algebra, any Boolean function can be expressed in the canonical disjunctive normal form ( CDNF) or minterm canonical form and its dual canonical conjunctive normal form ( CCNF) or maxterm canonical form. Other canonical forms include ...
) ** Blake canonical form, the OR of all the prime implicants of the function Boolean formulas can also be displayed as a graph: * Propositional directed acyclic graph **
Digital circuit In theoretical computer science, a circuit is a model of computation in which input values proceed through a sequence of gates, each of which computes a function. Circuits of this kind provide a generalization of Boolean circuits and a mathematical ...
diagram of logic gates, a Boolean circuit ** And-inverter graph, using only AND and NOT In order to optimize electronic circuits, Boolean formulas can be minimized using the Quine–McCluskey algorithm or Karnaugh map.


Analysis


Properties

A Boolean function can have a variety of properties: * Constant: Is always true or always false regardless of its arguments. * Monotone: for every combination of argument values, changing an argument from false to true can only cause the output to switch from false to true and not from true to false. A function is said to be unate in a certain variable if it is monotone with respect to changes in that variable. * Linear: for each variable, flipping the value of the variable either always makes a difference in the truth value or never makes a difference (a parity function). * Symmetric: the value does not depend on the order of its arguments. * Read-once: Can be expressed with conjunction, disjunction, and
negation In logic, negation, also called the logical complement, is an operation that takes a proposition P to another proposition "not P", written \neg P, \mathord P or \overline. It is interpreted intuitively as being true when P is false, and false ...
with a single instance of each variable. * Balanced: if its truth table contains an equal amount of zeros and ones. The Hamming weight of the function is the number of ones in the truth table. *
Bent Bent may refer to: Places * Bent, Iran, a city in Sistan and Baluchestan Province, Iran * Bent District, an administrative subdivision of Iran * Bent, Netherlands, a village in the municipality of Rijnwoude, the Netherlands * Bent County, Colo ...
: its derivatives are all balanced (the autocorrelation spectrum is zero) * Correlation immune to ''m''th order: if the output is uncorrelated with all (linear) combinations of at most ''m'' arguments * Evasive: if evaluation of the function always requires the value of all arguments *A Boolean function is a ''Sheffer function'' if it can be used to create (by composition) any arbitrary Boolean function (see functional completeness) *The ''algebraic degree'' of a function is the order of the highest order monomial in its
algebraic normal form In Boolean algebra, the algebraic normal form (ANF), ring sum normal form (RSNF or RNF), '' Zhegalkin normal form'', or '' Reed–Muller expansion'' is a way of writing logical formulas in one of three subforms: * The entire formula is purely tr ...
Circuit complexity attempts to classify Boolean functions with respect to the size or depth of circuits that can compute them.


Derived functions

A Boolean function may be decomposed using
Boole's expansion theorem Boole's expansion theorem, often referred to as the Shannon expansion or decomposition, is the identity: F = x \cdot F_x + x' \cdot F_, where F is any Boolean function, x is a variable, x' is the complement of x, and F_xand F_ are F with the argume ...
in positive and negative ''Shannon'' ''cofactors'' ( Shannon expansion), which are the (k-1)-ary functions resulting from fixing one of the arguments (to zero or one). The general (k-ary) functions obtained by imposing a linear constraint on a set of inputs (a linear subspace) are known as ''subfunctions''. The ''
Boolean derivative Boolean differential calculus (BDC) (German: (BDK)) is a subject field of Boolean algebra discussing changes of Boolean variables and Boolean functions. Boolean differential calculus concepts are analogous to those of classical differential cal ...
'' of the function to one of the arguments is a (k-1)-ary function that is true when the output of the function is sensitive to the chosen input variable; it is the XOR of the two corresponding cofactors. A derivative and a cofactor are used in a
Reed–Muller expansion In Boolean logic, a Reed–Muller expansion (or Davio expansion) is a decomposition of a Boolean function. For a Boolean function f(x_1,\ldots,x_n) : \mathbb^n \to \mathbb we call : \begin f_(x) & = f(x_1,\ldots,x_,1,x_,\ldots,x_n) \\ f_(x)& = ...
. The concept can be generalized as a k-ary derivative in the direction dx, obtained as the difference (XOR) of the function at x and x + dx. The '' Möbius transform'' (or ''Boole-Möbius transform'') of a Boolean function is the set of coefficients of its polynomial (
algebraic normal form In Boolean algebra, the algebraic normal form (ANF), ring sum normal form (RSNF or RNF), '' Zhegalkin normal form'', or '' Reed–Muller expansion'' is a way of writing logical formulas in one of three subforms: * The entire formula is purely tr ...
), as a function of the monomial exponent vectors. It is a self-inverse transform. It can be calculated efficiently using a butterfly algorithm ("''Fast Möbius Transform''"), analogous to the
Fast Fourier Transform A fast Fourier transform (FFT) is an algorithm that computes the discrete Fourier transform (DFT) of a sequence, or its inverse (IDFT). Fourier analysis converts a signal from its original domain (often time or space) to a representation in th ...
. ''Coincident'' Boolean functions are equal to their Möbius transform, i.e. their truth table (minterm) values equal their algebraic (monomial) coefficients. There are 2^2^(''k''−1) coincident functions of ''k'' arguments.


Cryptographic analysis

The '' Walsh transform'' of a Boolean function is a k-ary integer-valued function giving the coefficients of a decomposition into linear functions (
Walsh functions In mathematics, more specifically in harmonic analysis, Walsh functions form a complete orthogonal set of functions that can be used to represent any discrete function—just like trigonometric functions can be used to represent any continuous fu ...
), analogous to the decomposition of real-valued functions into harmonics by the
Fourier transform A Fourier transform (FT) is a mathematical transform that decomposes functions into frequency components, which are represented by the output of the transform as a function of frequency. Most commonly functions of time or space are transformed, ...
. Its square is the ''power spectrum'' or ''Walsh spectrum''. The Walsh coefficient of a single bit vector is a measure for the correlation of that bit with the output of the Boolean function. The maximum (in absolute value) Walsh coefficient is known as the ''linearity'' of the function. The highest number of bits (order) for which all Walsh coefficients are 0 (i.e. the subfunctions are balanced) is known as ''resiliency'', and the function is said to be correlation immune to that order. The Walsh coefficients play a key role in linear cryptanalysis. The ''
autocorrelation Autocorrelation, sometimes known as serial correlation in the discrete time case, is the correlation of a signal with a delayed copy of itself as a function of delay. Informally, it is the similarity between observations of a random variable ...
'' of a Boolean function is a k-ary integer-valued function giving the correlation between a certain set of changes in the inputs and the function ouput. For a given bit vector it is related to the Hamming weight of the derivative in that direction. The maximal autocorrelation coefficient (in absolute value) is known as the ''absolute indicator''. If all autocorrelation coefficients are 0 (i.e. the derivatives are balanced) for a certain number of bits then the function is said to satisfy the ''propagation criterion'' to that order; if they are all zero then the function is a bent function. The autocorrelation coefficients play a key role in
differential cryptanalysis Differential cryptanalysis is a general form of cryptanalysis applicable primarily to block ciphers, but also to stream ciphers and cryptographic hash functions. In the broadest sense, it is the study of how differences in information input can aff ...
. The Walsh coefficients of a Boolean function and its autocorrelation coefficients are related by the equivalent of the Wiener–Khinchin theorem, which states that the autocorrelation and the power spectrum are a Walsh transform pair. These concepts can be extended naturally to ''vectorial'' Boolean functions by considering their output bits (''coordinates'') individually, or more thoroughly, by looking at the set of all linear functions of output bits, known as its ''components''. The set of Walsh transforms of the components is known as a ''Linear Approximation Table'' (LAT) or ''correlation matrix''; it describes the correlation between different linear combinations of input and output bits. The set of autocorrelation coefficients of the components is the ''autocorrelation table'', related by a Walsh transform of the components to the more widely used ''Difference Distribution Table'' (DDT) which lists the correlations between differences in input and output bits (see also: S-box).


Real polynomial form


On the unit hypercube

Any Boolean function f(x): \^n \rightarrow \ can be uniquely extended (interpolated) to the real domain by a multilinear polynomial in \mathbb^n, constructed by summing the truth table values multiplied by indicator polynomials:f^*(x) = \sum_ f(a) \prod_ x_i \prod_ (1-x_i)For example, the extension of the binary XOR function x \oplus y is0(1-x)(1-y) + 1x(1-y) + 1(1-x)y + 0xywhich equalsx + y -2xySome other examples are negation (1-x), AND (xy) and OR (x + y - xy). When all operands are independent (share no variables) a function's polynomial form can be found by repeatedly applying the polynomials of the operators in a Boolean formula. When the coefficients are calculated modulo 2 one obtains the
algebraic normal form In Boolean algebra, the algebraic normal form (ANF), ring sum normal form (RSNF or RNF), '' Zhegalkin normal form'', or '' Reed–Muller expansion'' is a way of writing logical formulas in one of three subforms: * The entire formula is purely tr ...
(
Zhegalkin polynomial Zhegalkin (also Žegalkin, Gégalkine or Shegalkin) polynomials (russian: полиномы Жегалкина), also known as algebraic normal form, are a representation of functions in Boolean algebra. Introduced by the Russian mathematician Iva ...
). Direct expressions for the coefficients of the polynomial can be derived by taking an appropriate derivative:\begin f^*(00) & = & (f^*)(00) & = & f(00) \\ f^*(01) & = & (\partial_1f^*)(00) & = & -f(00) + f(01) \\ f^*(10) & = & (\partial_2f^*)(00) & = & -f(00) + f(10) \\ f^*(11) & = & (\partial_1\partial_2f^*)(00) & = & f(00) -f(01)-f(10)+f(11) \\ \endthis generalizes as the Möbius inversion of the partially ordered set of bit vectors:f^*(m) = \sum_ (-1)^ f(a)where , a, denotes the weight of the bit vector a. Taken modulo 2, this is the Boolean ''Möbius transform'', giving the
algebraic normal form In Boolean algebra, the algebraic normal form (ANF), ring sum normal form (RSNF or RNF), '' Zhegalkin normal form'', or '' Reed–Muller expansion'' is a way of writing logical formulas in one of three subforms: * The entire formula is purely tr ...
coefficients:\hat f(m) = \bigoplus_ f(a)In both cases, the sum is taken over all bit-vectors ''a'' covered by ''m'', i.e. the "one" bits of ''a'' form a subset of the one bits of ''m''. When the domain is restricted to the n-dimensional
hypercube In geometry, a hypercube is an ''n''-dimensional analogue of a square () and a cube (). It is a closed, compact, convex figure whose 1- skeleton consists of groups of opposite parallel line segments aligned in each of the space's dimensions, ...
,1n, the polynomial f^*(x): ,1n \rightarrow ,1/math> gives the probability of a positive outcome when the Boolean function ''f'' is applied to ''n'' independent random ( Bernoulli) variables, with individual probabilities ''x''. A special case of this fact is the
piling-up lemma In cryptanalysis, the piling-up lemma is a principle used in linear cryptanalysis to construct linear approximation, linear approximations to the action of block ciphers. It was introduced by Mitsuru Matsui (1993) as an analytical tool for linear c ...
for parity functions. The polynomial form of a Boolean function can also be used as its natural extension to
fuzzy logic Fuzzy logic is a form of many-valued logic in which the truth value of variables may be any real number between 0 and 1. It is employed to handle the concept of partial truth, where the truth value may range between completely true and completely ...
.


On the symmetric hypercube

Often, the Boolean domain is taken as \, with false ("0") mapping to 1 and true ("1") to -1 (see Analysis of Boolean functions). The polynomial corresponding to g(x): \^n \rightarrow \ is then given by:g^*(x) = \sum_ g(a) \prod_ \frac \prod_ \fracUsing the symmetric Boolean domain simplifies certain aspects of the analysis, since negation corresponds to multiplying by -1 and linear functions are monomials (XOR is multiplication). This polynomial form thus corresponds to the ''Walsh transform'' (in this context also known as ''Fourier transform'') of the function (see above). The polynomial also has the same statistical interpretation as the one in the standard Boolean domain, except that it now deals with the expected values E(X) = P(X=1) - P(X=-1) \in
1, 1 Onekama ( ) is a village in Manistee County in the U.S. state of Michigan. The population was 411 at the 2010 census. The village is located on the shores of Portage Lake and is surrounded by Onekama Township. The town's name is derived from "On ...
/math> (see
piling-up lemma In cryptanalysis, the piling-up lemma is a principle used in linear cryptanalysis to construct linear approximation, linear approximations to the action of block ciphers. It was introduced by Mitsuru Matsui (1993) as an analytical tool for linear c ...
for an example).


Applications

Boolean functions play a basic role in questions of complexity theory as well as the design of processors for digital computers, where they are implemented in electronic circuits using logic gates. The properties of Boolean functions are critical in cryptography, particularly in the design of symmetric key algorithms (see substitution box). In cooperative game theory, monotone Boolean functions are called simple games (voting games); this notion is applied to solve problems in social choice theory.


See also

*
Pseudo-Boolean function In mathematics and optimization, a pseudo-Boolean function is a function (mathematics), function of the form :f: \mathbf^n \to \R, where is a ''Boolean domain'' and is a nonnegative integer called the arity of the function. A Boolean function is ...
* Boolean-valued function * Boolean algebra topics *
Algebra of sets In mathematics, the algebra of sets, not to be confused with the mathematical structure of ''an'' algebra of sets, defines the properties and laws of sets, the set-theoretic operations of union, intersection, and complementation and the ...
* Decision tree model *
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 , one has \mathbf_(x)=1 if x\i ...
*
Signed set In mathematics, a signed set is a set of elements together with an assignment of a sign (positive or negative) to each element of the set. Representation Signed sets may be represented mathematically as an ordered pair of disjoint sets, one set for ...


References


Further reading

* * * * * {{DEFAULTSORT:Boolean function Boolean algebra Binary arithmetic Logic gates Programming constructs