Majority function
|
The majority function is a logic function from n inputs to one output, defined as follows: If more inputs are TRUE than are FALSE, then the majority function returns TRUE. Otherwise, the function returns FALSE.
Representing TRUE as 1 and FALSE as 0 provides this alternate definition: <math>\operatorname{Majority} \left ( p_{1..n} \right ) = \left \lfloor \frac{1}{2} + \frac{\sum_{i=1}^n p_i - 1/2}{n} \right \rfloor <math>
The "- 1/2" in the formula serves to break ties in favor of FALSE.