P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each...

27
P Vs NP Turing Machine

Transcript of P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each...

Page 1: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

P Vs NP

Turing Machine

Page 2: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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 qaccept or qreject.

• 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

Page 3: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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 − {qaccept, qreject}) × Γ → Q × Γ × {−1, 1}

Page 4: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

Definitions - Turing Machine

• given δ(q, s) = (q1, s1, h) in Γ,• If M is in q, • Scanning s Then• q1 is the new state

• s1 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 qaccept or qreject

Page 5: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

Definitions - Turing Machine

• Example of simulator:• http://ironphoenix.org/tril/tm/

Page 6: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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.

Page 7: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

Definitions – tM(w)

• Time M takes to accept w - number of steps• tM(w) = ∞ means M never halts.

Page 8: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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

Page 9: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

Definitions – Polynomial Time

• M runs in Polynomial time:• There exists k, such that for all n• TM(n) ≤ nk + k

Page 10: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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 }

Page 11: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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

Page 12: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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 LR over Σ Σ1 {#}∪ ∪ is defined as:

LR = {w#y | R(w, y)}• # is used to separate w and y• R is Polynomial iff LR P.∈

Page 13: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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

Page 14: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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 !

Page 15: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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)}∃

Page 16: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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.)

Page 17: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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.

Page 18: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

History - Reducibility

• Symbol for one to many reducibility is ≤m • Definition:

Suppose that Li is a language over Σi, i = 1, 2.

Then L1 ≤m L2 iff

there is a (total) computable function f : Σ1

*→ Σ2* , such that

x L∈ 1 f(x) L⇐⇒ ∈ 2, for all x ∈ Σ1*

Page 19: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

History – Reducibility: Consequences

• if L1 ≤m L2 and L2 is decidable, then L1 is decidable.

• Alternatively: if HP ≤m L then L is undecidable

Page 20: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

History – Reducibility: Example

• Travelling Salesman Problem can be reduced to Hamiltonian Graph Problem

Page 21: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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.

Page 22: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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 n100 a “good Algorithm” ?• NP-Complete is plynomial time equivalent of

c.e. Complete.

Page 23: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

History - NP-Complete, Definition

• Suppose that Li is a language over Σi, i = 1, 2.

Then L1 ≤p L2 (L1 is p-reducible to L2) 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

Page 24: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

History - NP-Complete, Propositions

a) If L1 ≤p L2 and L2 P ∈ then L1 P∈ .

b) If L1 is NP-complete, L2 NP∈ , and L1 ≤p L2 then L2 is NP-complete.

c) If L is NP-complete and L P∈ , then P=NP.

Page 25: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

Some NP-Complete Problems - SAT

a) Satisfiability (SAT):given a boolean function F of M variables x1, x2 .. xM.

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

Page 26: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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)∨ ∨

Page 27: P Vs NP Turing Machine. Definitions - Turing Machine Turing Machine M has a tape of squares Each Square is capable of storing a symbol from set Γ (including.

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 != NPRef : http://www.win.tue.nl/~gwoegi/P-versus-NP.htm