Yuvraj Singh Chauhan
Back to blog

Understanding P vs NP: The Biggest Unsolved Problem in Computer Science

April 30, 20263 min read
CS Theory

Multiplying two large numbers is easy for a computer, but figuring out the prime factors of a massive number takes forever. We can easily verify a solved Sudoku puzzle, but solving a very large one from scratch is incredibly hard.

This brings us to the P vs NP problem - the most famous unsolved question in computer science and one of the seven Millennium Prize Problems (with a $1,000,000 bounty for its solver!).

What does P stand for?

P stands for Polynomial time. These are problems that computers can solve quickly.

If the size of a problem gets bigger (like sorting a list of 10 items vs 1,000,000 items), the time it takes to solve it grows at a reasonable, predictable rate (like n^2 or n*log(n)).

Examples of P problems:

  • Sorting a list of names alphabetically.
  • Finding the shortest path between two points on a map.
  • Multiplying two large numbers.

What does NP stand for?

NP stands for Nondeterministic Polynomial time. These are problems where if you are given the answer, you can verify if it's correct quickly (in polynomial time). However, we don't currently know of a fast way to find the answer from scratch.

Examples of NP problems:

  • Sudoku: If someone hands you a completed Sudoku board, you can check if it's right in seconds. But solving a massive blank board from scratch? That takes trial and error.
  • The Traveling Salesperson Problem: Given a list of cities, is there a route shorter than 500 miles that visits every city? Checking a proposed route is easy; finding the absolute best route is extremely difficult.
  • Cryptography: Factoring massive prime numbers (the basis of RSA encryption) is notoriously hard, but verifying that two primes multiply to a given number is trivial.

The Big Question

The core question of the P vs NP problem is simple:

If it is easy to check a solution, is it also inherently easy to find the solution?

If P = NP, it means every problem whose answer can be checked quickly can also be solved quickly. It would mean that finding the answer to complex logistical problems or cracking modern encryption would all become mathematically trivial for computers.

If P != NP, it means there are some problems that are fundamentally hard to solve, no matter how clever our algorithms get.

Why does it matter?

Our modern digital world relies on the assumption that P != NP. When you buy something online, your credit card is protected by cryptographic algorithms that are easy to verify but (we hope) impossibly hard to crack. If someone proved that P = NP, the entire foundation of internet security would collapse overnight.

For now, the problem remains unsolved. Until a brilliant mind cracks the code, we will continue to rely on approximation algorithms and heuristics to tackle the NP-hard problems that surround us every day.