Majority function
   HOME

TheInfoList



OR:

In
Boolean logic In mathematics and mathematical logic, Boolean algebra is a branch of algebra. It differs from elementary algebra in two ways. First, the values of the variables are the truth values ''true'' and ''false'', usually denoted 1 and 0, whereas ...
, the majority function (also called the median operator) is the Boolean function that evaluates to false when half or more arguments are false and true otherwise, i.e. the value of the function equals the value of the majority of the inputs. Representing true values as 1 and false values as 0, we may use the (real-valued) formula: :\langle p_1,\dots,p_n \rangle = \operatorname \left ( p_1,\dots,p_n \right ) = \left \lfloor \frac + \frac \right \rfloor. The "−1/2" in the formula serves to break ties in favor of zeros when the number of arguments ''n'' is even. If the term "−1/2" is omitted, the formula can be used for a function that breaks ties in favor of ones. Most applications deliberately force an odd number of inputs so they don't have to deal with the question of what happens when exactly half the inputs are 0 and exactly half the inputs are 1. The few systems that calculate the majority function on an even number of inputs are often biased towards "0"—they produce "0" when exactly half the inputs are 0 -- for example, a 4-input majority gate has a 0 output only when two or more 0's appear at its inputs. In a few systems, the tie can be broken randomly.


Boolean circuits

A ''majority gate'' is a
logical gate A logic gate is an idealized or physical device implementing a Boolean function, a logical operation performed on one or more binary inputs that produces a single binary output. Depending on the context, the term may refer to an ideal logic gate, ...
used in
circuit complexity In theoretical computer science, circuit complexity is a branch of computational complexity theory in which Boolean functions are classified according to the size or depth of the Boolean circuits that compute them. A related notion is the circui ...
and other applications of
Boolean circuits In computational complexity theory and circuit complexity, a Boolean circuit is a mathematical model for combinational digital logic circuits. A formal language can be decided by a family of Boolean circuits, one circuit for each possible input ...
. A majority gate returns true if and only if more than 50% of its inputs are true. For instance, in a
full adder An adder, or summer, is a digital circuit that performs addition of numbers. In many computers and other kinds of processors adders are used in the arithmetic logic units (ALUs). They are also used in other parts of the processor, where they are ...
, the carry output is found by applying a majority function to the three inputs, although frequently this part of the adder is broken down into several simpler logical gates. Many systems have
triple modular redundancy Triple is used in several contexts to mean "threefold" or a " treble": Sports * Triple (baseball), a three-base hit * A basketball three-point field goal * A figure skating jump with three rotations * In bowling terms, three strikes in a row * I ...
; they use the majority function for
majority logic decoding In error detection and correction, majority logic decoding is a method to decode repetition codes, based on the assumption that the largest number of occurrences of a symbol was the transmitted symbol. Theory In a binary alphabet made of 0,1, if a ...
to implement
error correction In information theory and coding theory with applications in computer science and telecommunication, error detection and correction (EDAC) or error control are techniques that enable reliable delivery of digital data over unreliable communica ...
. A major result in
circuit complexity In theoretical computer science, circuit complexity is a branch of computational complexity theory in which Boolean functions are classified according to the size or depth of the Boolean circuits that compute them. A related notion is the circui ...
asserts that the majority function cannot be computed by AC0 circuits of subexponential size.


Properties

For any ''x'', ''y'', and ''z'', the ternary median operator ⟨''x'', ''y'', ''z''⟩ satisfies the following equations. * ⟨''x'', ''y'', ''y''⟩ = ''y'' * ⟨''x'', ''y'', ''z''⟩ = ⟨''z'', ''x'', ''y''⟩ * ⟨''x'', ''y'', ''z''⟩ = ⟨''x'', ''z'', ''y''⟩ * ⟨⟨''x'', ''w'', ''y''⟩, ''w'', ''z''⟩ = ⟨''x'', ''w'', ⟨''y'', ''w'', ''z''⟩⟩ An abstract system satisfying these as axioms is a
median algebra In mathematics, a median algebra is a set with a ternary operation \langle x,y,z \rangle satisfying a set of axioms which generalise the notions of medians of triples of real numbers and of the Boolean majority function. The axioms are # \lang ...
.


Monotone formulae for majority

For ''n'' = 1 the median operator is just the unary identity operation ''x''. For ''n'' = 3 the ternary median operator can be expressed using conjunction and disjunction as ''xy'' + ''yz'' + ''zx''. Remarkably this expression denotes the same operation independently of whether the symbol + is interpreted as
inclusive or In logic, disjunction is a logical connective typically notated as \lor and read aloud as "or". For instance, the English language sentence "it is raining or it is snowing" can be represented in logic using the disjunctive formula R \lor S ...
or
exclusive or 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, , ...
. For an arbitrary ''n'' there exists a monotone formula for majority of size O(''n''5.3). This is proved using
probabilistic method The probabilistic method is a nonconstructive method, primarily used in combinatorics and pioneered by Paul Erdős, for proving the existence of a prescribed kind of mathematical object. It works by showing that if one randomly chooses objects fr ...
. Thus, this formula is non-constructive. Approaches exist for an explicit formula for majority of polynomial size: * Take the median from a
sorting network In computer science, comparator networks are abstract devices built up of a fixed number of "wires", carrying values, and comparator modules that connect pairs of wires, swapping the values on the wires if they are not in a desired order. Such net ...
, where each compare-and-swap "wire" is simply an OR gate and an AND gate. The AjtaiKomlósSzemerédi (AKS) construction is an example. * Combine the outputs of smaller majority circuits. * Derandomize the Valiant proof of a monotone formula.


Notes


References

*


See also

{{Commonscat-inline, Majority functions *
Boolean algebra (structure) In abstract algebra, a Boolean algebra or Boolean lattice is a complemented distributive lattice. This type of algebraic structure captures essential properties of both set operations and logic operations. A Boolean algebra can be seen as a gen ...
* Boolean algebras canonically defined *
Boyer–Moore majority vote algorithm The Boyer–Moore majority vote algorithm is an algorithm for finding the majority of a sequence of elements using linear time and constant space. It is named after Robert S. Boyer and J Strother Moore, who published it in 1981,. Originally publis ...
*
Majority problem (cellular automaton) The majority problem, or density classification task, is the problem of finding one-dimensional cellular automaton rules that accurately perform majority voting. Using local transition rules, cells cannot know the total count of all the ones in sys ...
Logic gates Circuit complexity Boolean algebra