Download presentation
Presentation is loading. Please wait.
Published byMelinda Warren Modified over 9 years ago
1
P Vs NP Turing Machine
2
Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including blank Symbol b) Σ is an input string such that Σ ⊆ Γ and b ∈ Γ − Σ. Machine Starts with input String Σ, Initial State is q₀, final state is q accept or q reject. At each step M is in a state q, scans symbol s The action is to output a symbol, enter a new state and move tape head left/right
3
Definitions - Turing Machine Formally, Turing Machine M is a Tuple: (Σ, Γ,Q, δ) Γ is the finite, non-empty alphabet of M Q is the finite, non-empty set of States of M Σ ⊆ Γ and b ∈ Γ − Σ. δ is the transition function, such that: δ : (Q − {q accept, q reject }) × Γ → Q × Γ × {−1, 1}
4
Definitions - Turing Machine given δ(q, s) = (q 1, s 1, h) in Γ, If M is in q, Scanning s Then q 1 is the new state s 1 is the output symbol The tape moves left if h is –1 or right if h is +1 M halts if it reaches a state q accept or q reject
5
Definitions - Turing Machine Example of simulator: http://ironphoenix.org/tril/tm/
6
Definitions – L(M) L(M) is a Language accepted by M, such that M is a Turing Machine Σ is finite, non-empty set of alphabet Σ * is the set of finite strings over Σ If w ∈ Σ * is Input to M L(M) = {w ∈ Σ ∗ | M accepts w} M halts at an accepting state.
7
Definitions – tM(w) Time M takes to accept w - number of steps tM(w) = ∞ means M never halts.
8
Definitions – TM(n) Worst case time for M For n ∈ N, TM(n) is worst case run time for M TM(n) = max{tM(w) | w ∈ Σ n }, where Σ n is set of all string in Σ of length n
9
Definitions – Polynomial Time M runs in Polynomial time: There exists k, such that for all n TM(n) ≤ n k + k
10
P P in P vs NP stands for Polynomial More specifically – Deterministic Polynomial P is a Set of Languages: P = {L | L = L(M), M runs in Polynomial Time }
11
Definitions – TM(n) Worst case time for M For n ∈ N, TM(n) is worst case run time for M TM(n) = max{tM(w) | w ∈ Σ n }, where Σ n is set of all string in Σ of length n
12
Definitions – Checking Relation Checking Relation is a binary relation: R ⊆ Σ * × Σ 1 *, Over some alphabet Σ and Σ 1 Sort of all sets of combinations over Σ and Σ 1 A Language L R over Σ ∪ Σ1 ∪ {#} is defined as: L R = {w#y | R(w, y)} # is used to separate w and y R is Polynomial iff L R ∈ P.
13
NP NP in P Vs NP stands for Non-deterministic Polynomial. A Language L over Σ is in NP iff there is k ∈ N, Polynomial Time checking Relation R, and for all w ∈ Σ * w ∈ L ⇐⇒ ∃ y(|y| ≤ |w| k and R(w, y)) Where |w| is length of w, |y| is the length of y
14
Is P = NP The question is: Suppose that solutions to a problem can be verified quickly. Then, can the solutions themselves also be computed quickly? Quickly is defined as in Polynomial time In Travelling Salesman Problem a route can be quickly verified, but the problem can be quickly solved !
15
History – c.e c.e. – Computably enumerable L is c.e. (or semi-decidable) iff L = L(M) for some Turing machine M L is c.e. iff there is checking relation R(x, y), L = {x | ∃ yR(x, y)}
16
History – Decidable L is decidable iff L = L(M) for some Turing machine M which satisfies the condition that M halts on all input strings w (compare with c.e.)
17
History - c.e. and Decidable Halting Problem (HP): HP = {M | M is a Turing machine which halts on input M} HP is c.e. but it is not decidable.
18
History - Reducibility Symbol for one to many reducibility is ≤ m Definition: Suppose that L i is a language over Σ i, i = 1, 2. Then L 1 ≤ m L 2 iff there is a (total) computable function f : Σ 1 * → Σ 2 *, such that x ∈ L 1 ⇐⇒ f(x) ∈ L 2, for all x ∈ Σ 1 *
19
History – Reducibility: Consequences if L 1 ≤ m L 2 and L 2 is decidable, then L 1 is decidable. Alternatively: if HP ≤ m L then L is undecidable
20
History – Reducibility: Example Travelling Salesman Problem can be reduced to Hamiltonian Graph Problem
21
History - NP-Complete, c.e. Complete c.e. complete definition: A language L is c.e.-complete iff L is c.e., and L ’ ≤ m L for every c.e. language L HP is c.e. Complete ≤ m is transitive.
22
History - NP-Complete, Polynomial time Polynomial Time computation first introduced in 1960s by Cobham [Cob64] and Edmonds [Edm65]. Polynomial Time Algorithms – “good Algorithms” Is Polynomial of n 100 a “good Algorithm” ? NP-Complete is plynomial time equivalent of c.e. Complete.
23
History - NP-Complete, Definition Suppose that L i is a language over Σ i, i = 1, 2. Then L 1 ≤ p L 2 (L 1 is p-reducible to L 2 ) iff there is a polynomial-time computable function f : Σ 1 * → Σ 2 *, such that x ∈ L 1 ⇐⇒ f(x) ∈ L 2, for all x ∈ Σ 1 * A language L is NP-complete iff L is in NP, and L ’ ≤ p L for every language L ’ in NP Focus on reducibility is polynomial
24
History - NP-Complete, Propositions a)If L 1 ≤ p L 2 and L 2 ∈ P then L 1 ∈ P. b)If L 1 is NP-complete, L 2 ∈ NP, and L 1 ≤ p L 2 then L 2 is NP-complete. c)If L is NP-complete and L ∈ P, then P=NP.
25
Some NP-Complete Problems - SAT a)Satisfiability (SAT): given a boolean function F of M variables x 1, x 2.. x M. F can involve the operators and, or and not. The problem is to find values for these variables which give the function F the value true
26
Some NP-Complete Problems - 3SAT a)An important special case of Satisfiability is 3- SAT Satisfiability (SAT). Instances of 3-SAT are restricted to formulas in conjunctive normal form with three literals per clause: (P ∨ Q ∨ R) ∧ ( ~P ∨ Q ∨ ~R) ∧ (P ∨ ~Q ∨ S) ∧ ( ~P ∨ ~R ∨ ~S)
27
Attempts at proving Over the years several attempts have been made to Prove P = NP or P != NP The latest in Aug 2010 by Vinay Deolalikar announcing P != NP. Shown to be no correct Since 1987, 34 papers try to Prove P = NP Since 1987, 25 papers try to Prove P != NP Ref : http://www.win.tue.nl/~gwoegi/P-versus-NP.htm
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.