In
Boolean algebra, a parity function is a
Boolean function whose value is one
if and only if
In logic and related fields such as mathematics and philosophy, "if and only if" (often shortened as "iff") is paraphrased by the biconditional, a logical connective between statements. The biconditional is true in two cases, where either bo ...
the input vector has an odd number of ones. The parity function of two inputs is also known as the
XOR function.
The parity function is notable for its role in theoretical investigation of
circuit complexity of Boolean functions.
The output of the parity function is the
parity bit.
Definition
The
-variable parity function is the
Boolean function with the property that
if and only if
In logic and related fields such as mathematics and philosophy, "if and only if" (often shortened as "iff") is paraphrased by the biconditional, a logical connective between statements. The biconditional is true in two cases, where either bo ...
the number of ones in the vector
is odd.
In other words,
is defined as follows:
:
where
denotes
exclusive or.
Properties
Parity only depends on the number of ones and is therefore a
symmetric Boolean function.
The ''n''-variable parity function and its negation are the only Boolean functions for which all
disjunctive normal forms have the maximal number of 2
''n'' − 1 monomials of length ''n'' and all
conjunctive normal forms have the maximal number of 2
''n'' − 1 clauses of length ''n''.
[ Ingo Wegener, Randall J. Pruim, ''Complexity Theory'', 2005, ]
p. 260
/ref>
Computational complexity
Some of the earliest work in computational complexity was 1961 bound of Bella Subbotovskaya showing the size of a Boolean formula computing parity must be at least . This work uses the method of random restrictions. This exponent of has been increased through careful analysis to by Paterson and Zwick (1993) and then to by Håstad (1998).
In the early 1980s, Merrick Furst, James Saxe and Michael Sipser[Merrick Furst, James Saxe and Michael Sipser, "Parity, Circuits, and the Polynomial-Time Hierarchy", Annu. Intl. Symp. Found.Computer Sci., 1981, '' Theory of Computing Systems'', vol. 17, no. 1, 1984, pp. 13–27, ] and independently Miklós Ajtai[Miklós Ajtai, "-Formulae on Finite Structures", '' Annals of Pure and Applied Logic'', 24 (1983) 1–48.] established super-polynomial lower bounds on the size of constant-depth Boolean circuits for the parity function, i.e., they showed that polynomial-size constant-depth circuits cannot compute the parity function. Similar results were also established for the majority, multiplication and transitive closure functions, by reduction from the parity function.[
established tight exponential lower bounds on the size of constant-depth Boolean circuits for the parity function. Håstad's Switching Lemma is the key technical tool used for these lower bounds and Johan Håstad was awarded the Gödel Prize for this work in 1994.
The precise result is that depth- circuits with AND, OR, and NOT gates require size to compute the parity function.
This is asymptotically almost optimal as there are depth- circuits computing parity which have size .
]
Infinite version
An infinite parity function is a function mapping every infinite binary string to 0 or 1, having the following property: if and are infinite binary strings differing only on finite number of coordinates then if and only if and differ on even number of coordinates.
Assuming axiom of choice
In mathematics, the axiom of choice, abbreviated AC or AoC, is an axiom of set theory. Informally put, the axiom of choice says that given any collection of non-empty sets, it is possible to construct a new set by choosing one element from e ...
it can be proved that parity functions exist and there are many of them; as many as the number of all functions from to . It is enough to take one representative per equivalence class of relation defined as follows: if and differ at finite number of coordinates. Having such representatives, we can map all of them to ; the rest of values are deducted unambiguously.
Another construction of an infinite parity function can be done using a non-principal ultrafilter on . The existence of non-principal ultrafilters on follows from – and is strictly weaker than – the axiom of choice. For any we consider the set . The infinite parity function is defined by mapping to if and only if is an element of the ultrafilter.
It is necessary to assume at least some amount of choice to prove that infinite parity functions exist. If is an infinite parity function and we consider the inverse image