Counting complexity Created 2026-09-28 Updated 2026-11-05
Counting complexity studies the computational resources needed to count solutions. For a polynomial time decidable binary relation and a polynomial , a standard counting function is
The complexity class consists of these functions, equivalently the numbers of accepting computations of Nondeterministic Turing machines running in polynomial time. The witness encoding matters: counting computation paths and counting distinct outputs can give different answers.
For the propositional formula , the satisfying Boolean valuations are , and , so the answer is three. The associated decision problem asks only whether that count is positive. For a zero-one matrix, the permanent of a matrix counts perfect matchings in a bipartite graph. Testing whether any such perfect matching exists admits a polynomial-time algorithm, while counting them is -complete under polynomial-time Turing reductions.[ref]
Leslie G. Valiant 2026-11-05
Leslie G. Valiant proved in 1979 that computing the permanent of a zero-one matrix is complete for the counting complexity class under the paper's arithmetic reductions.[ref]
For a bipartite graph's zero-one adjacency matrix, the permanent counts perfect matchings. Deciding whether one exists admits a polynomial-time algorithm, while counting all of them has the paper's much stronger completeness property. This makes the difference between existence and counting concrete. The permanent resembles the determinant but lacks its alternating signs, so an efficient determinant algorithm does not automatically compute it. Valiant's permanent reduction encodes logical constraints into weighted combinatorial choices.