Documentation

CslibFrontier.Computability.PolyTime.Plurality

Polynomial-time plurality #

The multitape certificate for Cslib.ProbComp.plurality works on framed lists. The scan compares the frequencies of the current and next candidates, retaining the current candidate on ties. The accumulator is empty or holds one input element.

Plurality of a framed list takes polynomial time in its encoded length. The first most frequent element wins, with a fixed fallback for the empty list.