Download presentation
Presentation is loading. Please wait.
1
Unsolvable Problems December 4, 2017
2
Traveling salesman problem
“Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city?”
3
Unsolvable problems There exist problems that a computer will never be able to solve. Such problems are known as unsolvable problems. One famous example of an unsolvable problem is the halting problem. Alan Turing used this as part of a proof of the existence of problems that cannot be solved by a computer in 1936.
4
Halting problem The halting problem is to look at a program and determine whether or not it will run forever (i.e., whether it will eventually halt). A program “solves the halting problem” if it can determine whether another program will run forever or not. There is no program that solves the halting problem. We can prove this by contradiction…
5
P vs. NP Central question: Are problems that are easy to check also easy to solve? If we can “quickly” check whether the solution to a problem is correct, can we also “quickly” find that solution? P and NP are sets of problems that require an algorithm to solve. We know P is a subset of NP (that is, every problem that can be solved quickly can also be checked quickly). Question: is NP a subset of P? That is, can every problem that can be checked quickly also be solved quickly?
6
P vs. NP P is the set of problems that can be solved “quickly.”
Formally: P is the set of problems for which there exists a polynomial time algorithm (in O(nc), where c is some constant) that generates a solution. Problems in P include: Finding the GCF of two numbers Multiplication Determining whether a number is prime This took until 2002 to discover!
7
P vs. NP NP is the set of problems whose solutions can be checked “quickly.” Formally: NP is the set of problems for which there exists a polynomial time algorithm (in O(nc), where c is some constant) to check whether a solution is correct. Problems in NP include: Sudoku Multiplication Prime factorization Traveling salesman problem
8
NP-Completeness Cook-Levin theorem: Some algorithmic problems are connected by a “core” (i.e., common) difficulty. These problems are known as NP-complete problems. If you can find an algorithm to quickly solve one of these problems, you can use the same algorithm to solve a seemingly completely different problem. Think of long division: no matter what two numbers you’re dividing, you always use the same algorithm.
9
P vs. NP How can this be answered?
To prove P = NP: Give a polynomial-time algorithm to solve any NP-complete problem. To prove P ≠ NP: Prove there exists no algorithm to solve some NP problem in polynomial time. This is much harder than it sounds!
10
P vs. NP What happens if P = NP (i.e., why should we care)?
RSA encryption is very easy to crack! Major implications for the economy. Potential to write a program that can determine mathematical proofs.
11
Heuristics When we can’t quickly solve a problem, we use a heuristic: a solution that’s not exact but is “good enough.” A heuristic is used when finding an exact or optimal solution is impractical or impossible. Any type of optimization problem is generally going to be solved using a heuristic. Traveling salesman problem What is the quickest route between two points? What is the “best” method of image compression? The alternative is to solve by brute force: trying every possible solution and then seeing which achieves the desired goal.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.