ArticleslgStudy

science

Co-NP

Co-NP is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Co-NP rather than just read about it. In short: In computational complexity theory, co-NP is a complexity class. A decision problem X is a member of co-NP if and only if its complement X is in the complexity class NP.

Co-NP — main illustration
Co-NP — illustration

Key takeaways

  • Co-NP belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Co-NP to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Co-NP from memory before moving on to harder problems.

Reference excerpt

In computational complexity theory, co-NP is a complexity class. A decision problem X is a member of co-NP if and only if its complement X is in the complexity class NP. The class can be defined as follows: a decision problem is in co-NP if and only if for every no-instance we have a polynomial-length "certificate" and there is a polynomial-time algorithm that can be used to verify any purported certificate. That is, co-NP is the set of decision problems where there exists a polynomial ⁠p(n)⁠ and a polynomial-time bounded Turing machine M such that for every instance x, x is a no-instance if and only if: for some possible certificate c of length bounded by ⁠p(n)⁠, the Turing machine M accepts the pair (x, c).

Complementary problems

While an NP problem asks whether a given instance is a yes-instance, its complement asks whether an instance is a no-instance, which means the complement is in co-NP. Any yes-instance for the original NP problem becomes a no-instance for its complement, and vice versa.

Unsatisfiability

An example of an NP-complete problem is the Boolean satisfiability problem: given a Boolean formula, is it satisfiable (is there a possible input for which the formula outputs true)? The complementary problem asks: "given a Boolean formula, is it unsatisfiable (do all possible inputs to the formula output false)?". Since this is the complement of the satisfiability problem, a certificate for a no-instance is the same as for a yes-instance from the original NP problem: a set of Boolean variable assignments which make the formula true. On the other hand, a certificate of a yes-instance for the complementary problem (whatever form it might take) would be equally as complex as for the no-instance of the original NP satisfiability problem.

co-NP-completeness

A problem L is co-NP-complete if and only if L is in co-NP and for any problem in co-NP, there exists a polynomial-time reduction from that problem to L.

Tautology reduction Determining if a formula in propositional logic is a tautology is co-NP-complete: that is, if the formula evaluates to true under every possible assignment to its variables.

Relationship to other classes

P, the class of polynomial time solvable problems, is a subset of both NP and co-NP. P is thought to be a strict subset in both cases. Because P is closed under complementation, and NP and co-NP are complementary, it cannot be strict in one case and not strict in the other: if P equals NP, it must also equal co-NP, and vice versa. NP and co-NP are also thought to be unequal, and their equality would imply the collapse of the polynomial hierarchy PH to NP. If they are unequal, then no NP-complete problem can be in co-NP and no co-NP-complete problem can be in NP. This can be shown as follows. Suppose for the sake of contradiction there exists an NP-complete problem X that is in co-NP. Since all problems in NP can be reduced to X, it follows that for every problem in NP, we can construct a non-deterministic Turing machine that decides its complement in polynomial time; i.e., ⁠𝖭𝖯⊆𝖼𝗈-𝖭𝖯⁠. From this, it follows that the set of complements of the problems in NP is a subset of the set of complements of the problems in co-NP; i.e., ⁠𝖼𝗈-𝖭𝖯⊆𝖭𝖯⁠. Thus ⁠𝖼𝗈-𝖭𝖯=𝖭𝖯⁠. The proof that no co-NP-complete problem can be in NP if ⁠𝖭𝖯≠𝖼𝗈-𝖭𝖯⁠ is symmetrical. co-NP is a subset of PH, which itself is a subset of PSPACE.

Integer factorization

An example of a problem that is known to belong to both NP and co-NP (but not known to be in P) is integer factorization: given positive integers m and n, determine if m has a factor less than n and greater than one. Membership in NP is clear; if m does have such a factor, then the factor itself is a certificate. Membership in co-NP is also straightforward: one can just list the prime factors of m, all greater or equal to n, which the verifier can confirm to be valid by multiplication and the AKS primality test. It is presently not known whether there is a polynomial-time algorithm for factorization, equivalently that integer factorization is in P, and hence this example is interesting as one of the most natural problems known to be in NP and co-NP but not known to be in P.

References

External links Complexity Zoo: coNP

Worked examples

Example 1 — a first encounter with Co-NP

Start with the simplest possible case. Write down what Co-NP claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Co-NP before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Co-NP ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Co-NP

In research
Co-NP appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Co-NP in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Co-NP is common in secondary-school and first-year university syllabi. It links to neighbouring topics Complexity classes, so understanding it makes those chapters shorter.
In everyday life
Look for Co-NP outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Co-NP” →

How to study Co-NP in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Co-NP means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Co-NP out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Co-NP in simple terms?

In computational complexity theory, co-NP is a complexity class. A decision problem X is a member of co-NP if and only if its complement X is in the complexity class NP.

Why does Co-NP matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Co-NP?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Co-NP.

Tags

  • Complexity classes

Keep exploring