Exact two-query majority algorithm (source code)

= Exact two-query majority algorithm
{title2=$Q_E(\operatorname{MAJ}_3)=2$}

One exact parity query determines whether the first two bits agree. If they agree, a second query reads one of them; otherwise it reads the third bit. Those values respectively determine the three-bit <majority function>. The matching lower bound follows from its degree-three <multilinear polynomial>.