In computational complexity theory and computability theory, a counting problem is a type of computational problem. If R is a search problem (formalised as a binary relation) then
is the corresponding counting function and
denotes the corresponding decision problem.
Note that c<sub>R</sub> is a function problem while #R is a decision problem, however c<sub>R</sub> can be C Cook-reduced to #R (for appropriate C) using a binary search (the reason #R is defined the way it is, rather than being the graph of c<sub>R</sub>, is to make this binary search possible).
Just as NP has NP-complete problems via many-one reductions, #P has #P-complete problems via parsimonious reductions, problem transformations that preserve the number of solutions.