how hard can a problem be ?
DESCRIPTION
A Really Simple Introduction to Complexity and ComputabilityTRANSCRIPT
How Hard Can a Problem Be ?
Ahmad SaeedAlexandria University
Agenda
• Hard for whom ?• Easy Problems• Hard Problems• Unsolvable Problems !!
A Problem Solver (Turing Machine)
• Follow the instructions to solve the problem• Use a pencil, a rubber and a scrap paper• Use them to find the answer
• You now have a : Turing Machine
Turing Machines Formally
• Physicallyo A Scratch Tape (Infinite)o A Moving head
• Mathematicallyo A set of possible symbols to write on the tapeo A set of "states"o A transition function between states
Turing Machine Example
• Determine whether the number of 1's in a sequence is o odd (print 0 at the end of the tape) o even (print 1 at the end of the tape)
Church-Turing Thesis
Simply: If it's physically computable, it can be computed by a Turing Machine
"Easy" Problems (P)
• The class of problems that could be solved in Polynomial Time
• Exampleso Bubble Sort O(n2)o Matrix Multiplication O(n3)
• What about a problem of O(n100) ??
Nondeterminism
Nondeterminism (Example)
• Travelling Salesman ProblemFind the path with the least cost to visit a set of cities
Nondeterminism (Example)
• What if we were really great guessers ??
"Hard" Problems (NP)
• Nondeterministic Polynomial• Problems that are solved in a polynomial time if
you are (or have access to) a perfect guesser• Examples
o 3 CNF(conjunctive normal form) SAT(satisfiability)
o Scheduling Problem
Can all problems be solved by a computer ??
Halting Problem
• Given a binary representation of a program P, determine whether it enters an infinite loop on input X or not.
Halting Problem Proof
• Assume that we have Halt(P,x) which is a program that o returns 0 if program P terminates on input xo returns 1 it doesn't program doesn't halt
• Let M(x) be a program thato doesn't terminate (loops forever) if Halt(x,x)
returns 0o terminates if Halt(x,x) returns 1
• What's the results if M(M) ??
What have we been talking about ??
• Different models of computation boil down to Turing Machine
• N = NP ??? • Computers can't do everything but can we ??
References
• Computational Complexity: A Modern ApproachTextbook by Sanjeev Arora and Boaz Barak, Cambridge University Press.
• Lecture notes for cs1510 of Prof Kirk Pruhs of the Dept of Computer Science, University of Pittsburg
• Lecture notes for CSc2010 of Prof Jaman L. Bhola of the Dept of Computer Science, Georgia State University
• Wikipedia, 2011
Any Questions ??
(Open Discussion)