P/poly
In computational complexity theory, P/poly is a complexity class that can be defined in both circuit complexity and non-uniform complexity. Since the two definitions are equivalent, this concept bridges the two areas. In the perspective of circuit complexity, P/poly is the class of problems that can be solved by small circuits. More precisely, it is the set of formal languages that have polynomial-size circuit families. In the perspective of non-uniform complexity, P/poly is defined in terms of Turing machines with advice, extra information supplied to the Turing machine along with its input, that may depend on the input length but not on the input itself. In this formulation, P/poly is the class of decision problems that can be solved by a polynomial-time Turing machine with advice strings of length polynomial in the input size. For example, the popular Miller–Rabin primality test can be formulated as a P/poly algorithm: the "advice" is a list of candidate values to test. It is possible to precompute a list of O(n) values such that every composite -bit number will be certain to have a witness in the list. For example, to correctly determine the primality of 32-bit numbers, it is enough to test a\in\{2,7,61\} .…
In computational complexity theory, P/poly is a complexity class that can be defined in both circuit complexity and non-uniform complexity. Since the two definitions are equivalent, this concept bridges the two areas. In the perspective of circuit complexity, P/poly is the class of problems that can be solved by small circuits. More precisely, it is the set of formal languages that have polynomial-size circuit families. In the perspective of non-uniform complexity, P/poly is defined in terms of Turing machines with advice, extra information supplied to the Turing machine along with its input, that may depend on the input length but not on the input itself. In this formulation, P/poly is the class of decision problems that can be solved by a polynomial-time Turing machine with advice strings of length polynomial in the input size. For example, the popular Miller–Rabin primality test can be formulated as a P/poly algorithm: the "advice" is a list of candidate values to test. It is possible to precompute a list of O(n) values such that every composite -bit number will be certain to have a witness in the list. For example, to correctly determine the primality of 32-bit numbers, it is enough to test a\in\{2,7,61\} . The existence of short lists of candidate witnesses follows from the fact that for each composite , three out of four candidate values successfully detect that is composite. From this, a simple counting argument similar to the one in the proof that \mathsf{BPP} \subset \mathsf{P/poly} below shows that there exists a suitable list of candidate values for every input size, and more strongly that most long-enough lists of candidate values will work correctly, although finding a list that is guaranteed to work may be expensive. P/poly, unlike other polynomial-time classes such as P or BPP, is not generally considered a practical class for computing. Indeed, it contains every undecidable unary language, none of which can be solved in general by real computers. On the other hand, if the input length is bounded by a relatively small number and the advice strings are short, it can be used to model practical algorithms with a separate expensive preprocessing phase and a fast processing phase, as in the Miller–Rabin example. \mathsf{P/poly} = \bigcup_{c\in\mathbb{N}} \mathsf{SIZE}(n^c), where \mathsf{SIZE}(n^c) is the set of decision problems that can be solved by circuit families having no more than n^c gates on inputs of size n . Alternatively, \mathsf{P/poly} can be defined using Turing machines that "take advice". Such a machine has, for each , an advice string \alpha_n , which it is allowed to use in its computation whenever the input has size . To help visualize this equivalence, imagine that the advice for each is a description of a Boolean circuit having inputs, and that a Turing Machine for the language merely evaluates the given Boolean circuit on inputs of length . Let T,a: \mathbb{N} \rightarrow \mathbb{N} be functions. The class of languages decidable by time-T(n) Turing machines with a(n) advice, denoted \mathsf{DTIME}(T(n))/a(n) , contains every language L such that there exists a sequence \{\alpha_n\}_{n \in \mathbb{N}} of strings with \alpha_n \in \{0, 1\}^{a(n)} and a TM M satisfying M(x, \alpha_n) = 1 \Leftrightarrow x \in L for every x \in \{0, 1\}^n , where on input (x, \alpha_n) the machine M runs for at most O(T(n)) steps. If NP ⊆ P/poly then PH (the polynomial hierarchy) collapses to \Sigma_2^{\mathsf P} . This result is the Karp–Lipton theorem; furthermore, NP ⊆ P/poly implies AM = MA If PSPACE ⊆ P/poly then \mathsf{PSPACE} = \Sigma_2^{\mathsf P} \cap \Pi_2^{\mathsf P} , even PSPACE = MA. Proof: Consider a language L from PSPACE. It is known that there exists an interactive proof system for L, where actions of the prover can be carried out by a PSPACE machine. By assumption, the prover can be replaced by a polynomial-size circuit. Therefore, L has a MA protocol: Merlin sends the circuit as proof, and Arthur can simulate the IP protocol himself without any additional help. If P #P ⊆ P/poly then P #P = MA. The proof is similar to above, based on an interactive protocol for permanent and #P-completeness of permanent. If EXPTIME ⊆ P/poly then \mathsf{EXPTIME} =\Sigma_2^{\mathsf P} \cap \Pi_2^{\mathsf P} (Meyer's theorem), even EXPTIME = MA. If NEXPTIME ⊆ P/poly then NEXPTIME = EXPTIME, even NEXPTIME = MA. Conversely, NEXPTIME = MA implies NEXPTIME ⊆ P/poly If EXP NP ⊆ P/poly then \mathsf{EXP^{NP}} = \Sigma_2^{\mathsf P} \cap \Pi_2^{\mathsf P} (Buhrman, Homer) It is known that MA EXP , an exponential version of MA, is not contained in P/poly. Proof: If MA EXP ⊆ P/poly then PSPACE = MA (see above). By padding, EXPSPACE = MA EXP , therefore EXPSPACE ⊆ P/poly but this can be proven false with diagonalization. The best known bound for the square-root sum problem is in the fourth level of the counting hierarchy, and it is an unsolved problem whether better complexity is possible, but a unary version of the problem is in P/poly. One of the most interesting reasons that P/poly is important is the property that if NP is not a subset of P/poly, then P ≠ NP. This observation was the center of many attempts to prove P ≠ NP. It is known that for a random oracle A, NP A is not a subset of P A /poly with probability 1. P/poly is also used in the field of cryptography. Security is often defined 'against' P/poly adversaries. Besides including most practical models of computation like BPP, this also admits the possibility that adversaries can do heavy precomputation for inputs up to a certain length, as in the construction of rainbow tables. Although not all languages in P/poly are sparse languages, there is a polynomial-time Turing reduction from any language in P/poly to a sparse language.
References
No reference rows published for this article.
Cite this article
MLA
"P/poly." encyclopegia.org, 2026, https://encyclopegia.org/wiki/p-poly. Accessed 25 November 2026.
Chicago
"P/poly." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/p-poly.
APA
encyclopegia.org. (2026). P/poly. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/p-poly
Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON