P vs. NP

One of the fundamental mathematics problems of modern times.

Millennium Prize Problems

  1. Birch & Swinnerton-Dyer Conjecture
  2. Hodge Conjecture
  3. Navier-Stokes Equations
  4. P vs. NP
  5. Poincare Conjecture
  6. Riemann Hypothesis
  7. Yang-Mill Theory

P vs NP asks whether every problem whose solution can be quickly verified (technically, verified in polynomial time) can also be solved quickly (again, in polynomial time).


Halting Problem: Some problems can't be computed:

Unsolvable (by computer) Problem

that returns true if p halts on input i, and false if it doesn’t.

which loops if p halts on input i, and true if it doesn’t


Prime factor

In number theory, integer factorization is the decomposition of a composite number into a product of smaller integers. If these integers are further restricted to prime numbers, the process is called prime factorization.

Semi-primes are the product of two primes. These are the hardest instance of the prime factorization problem.

Which is harder?


prime factor


prime factor

Factoring is in NP


Problem Types


Class P


Class NP

By definition, it solves the problem if it’s capable of
generating and verifying a solution on one of its tries

Example: CNF satisfiability
Problem: is a boolean expression in its conjunctive normal form
(CNF) satisfiable, i.e., are there values of its variables that makes it
true?
This problem is in NP. Nondeterministic algorithm:

  1. Guess truth assignment
  2. Substitute the values into the CNF formula to see if it evaluates to true

Example: (A¬B¬C)(AB)(¬B¬DE)(¬D¬E)(A ⋁ ¬B ⋁ ¬C) ⋀ (A ⋁ B) ⋀ (¬B ⋁ ¬D ⋁ E) ⋀ (¬D ⋁ ¬E)

A B C D E
0 0 0 0 0
1 1 1 1 1

Checking phase: O(n)\mathcal{O}(n)

Some NP Problems
• Circuit Routing
• Travelling Salesman
• Knapsack problem
• Protein Folding
• Theorem Proving
• Crossword puzzle generation
• Sudoku


NP-Complete

A decision problem D is NP-complete if it is as hard as any
problem in NP, i.e.,

  1. D is in NP
  2. every problem in NP is polynomial-time reducible to D

NP-Complete

Other NP-complete problems obtained through polynomial-time
reductions from a known NP-complete problem

NP-Complete

NP-Complete


Knapsack?

Complexity of Dynamic Programming
algorithm is in O(nW)

DEFINITION 1 We say that an algorithm solves a
problem in polynomial time if its worst-case time
efficiency belongs to O(p(n)) where p(n) is a polynomial
of the problem’s input size n. [Levitin, p. 401]


P = NP ?

NP-Complete

Computation Complexity

A whole field of study that investigates classes of problems.

Co-NP is the class of all problems where a wrong answer can be quickly rejected

PSPACE - The set of all problems that can be solved using only a polynomial amount of addition space using a deterministic algorithm

NPSPACE The - the set of all problems that can be solved using only a polynomial amount of addition space using a nondeterministic algorithm

EXP - The set of all problems solvable in exponential time

BPP - Bounded-Error Probabilistic Polynomial-Time -The class of feasible problems given a genuine random-number source

EXPSPACE - The set of all problems that can be solved using only an exponential amount of addition space

NP-Complete