Follow your curiosity

What discovery has been shared with you?

Start with one fact. Explore it, go deeper, then follow whichever branch catches your imagination.

Choose subjects for a surprise

Exploring any topic

Begin your discovery

Your next discovery is one click away.

Choose one or more subjects above, or leave Any Topic selected and let curiosity decide.

Mathematics

Computational Complexity and the P Versus NP Problem

Quick fact

The P versus NP problem is one of the seven Millennium Prize Problems; a correct solution earns $1 million, and a proof that P = NP would collapse many modern cryptographic systems.

Why this is interesting

You have a lock that can be opened only by trying many combinations, but you can check any guess instantly. Could you design a master key that opens it without endless trial and error? This is the heart of the P versus NP problem.

Read the full explanation

Understanding Computational Complexity and the P Versus NP Problem

Imagine you have a jigsaw puzzle with thousands of pieces. Putting it together seems to take forever, but if someone hands you a completed picture, you can quickly verify it. In computer science, we classify problems by how fast they can be solved versus how fast their solutions can be checked. The class P contains problems that can be solved in polynomial time—time proportional to the input size raised to a power, like n² or n³. These are considered tractable. The class NP contains problems whose solutions can be verified in polynomial time, even if finding a solution might be hard. For example, finding a factor of a large number may be difficult, but checking if a proposed factor is correct is easy. The question is whether every problem in NP is also in P—i.e., whether 'checking quickly' implies 'solving quickly'. This is the P versus NP question. It may seem likely that some problems are genuinely hard, but no one has been able to prove it. The most famous NP problems are called NP-complete; if you could solve one of them quickly, you could solve all NP problems quickly.

A deeper explanation

Complexity theory formalizes this with time complexity functions on a Turing machine. P is the set of decision problems solvable by a deterministic Turing machine in polynomial time. NP is the set of problems for which a candidate solution can be verified in polynomial time by a deterministic machine, or equivalently, solved by a non-deterministic Turing machine in polynomial time—one that can guess the solution and then check it. A key concept is polynomial-time reducibility: problem A reduces to problem B if there is a polynomial-time transformation that maps instances of A to instances of B such that the answer is preserved. This allows us to compare the difficulty of problems. A problem is NP-complete if it is in NP and every other NP problem reduces to it. The Cook-Levin theorem showed the first such problem: SAT, the Boolean satisfiability problem. Since then, thousands of problems have been shown NP-complete, all equivalent in difficulty. The P versus NP question asks whether any NP-complete problem can be solved in polynomial time. If yes, then all can. If no, then there is a fundamental separation between what can be efficiently solved and what can only be efficiently verified. This matters enormously: cryptography relies on the assumption that certain NP problems are hard; optimization and scheduling algorithms would be revolutionized if P = NP. The problem remains open, and its resolution would reshape the theoretical foundations of computation.

Keep FACTREE close

Internet access is required. Updates arrive when you reopen or reload the app. You may need to sign in again in the installed app.