43
Computational Models Lecture 13 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. June 6/8, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 1 / 43

Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Computational Models — Lecture 131

Handout Mode

Ronitt Rubinfeld and Iftach Haitner.

Tel Aviv University.

June 6/8, 2016

1Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 1 / 43

Page 2: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Talk Outline

I Reminder - poly-time reductions, NP-completeness and SAT

I 3SAT ≤P CLIQUE

I SAT is NP-Complete

I SAT ≤P 3SAT

Sipser, 7.4–7.5

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 2 / 43

Page 3: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Section 1

Reminder

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 3 / 43

Page 4: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Reminder – Poly-time Reductions

Definition 1A language A is poly-time mapping reducible to B, denoted A ≤P B, if existspoly-time computable function f such that

w ∈ A⇐⇒ f (w) ∈ B

for every w ∈ Σ∗.The function f is called a polynomial-time reduction from A to B.

The mapping f efficiently converts questions about membership in A tomembership in B.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 4 / 43

Page 5: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Reminder – NP Completeness

Definition 2 (NP-complete)

A language B is NP-complete, if

I B ∈ NP, and

I Every A ∈ NP is poly-time reducible to B

We let NPC denote the class of all NP-complete languages.

ANP = {〈M, x ,1n〉 : M is a TM ∧ ∃c ∈ Σ∗ s.t.M(x , c) accepts within n steps}.

Theorem 3ANP ∈ NPC.

Theorem 4Assume that B ∈ NP, A ∈ NPC and A ≤P B, then B ∈ NPC.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 5 / 43

Page 6: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

What does a proof of NP-completeness look like?

Checklist:

I Show that L is in NPI Show that L is NP − hard : reduce from a known NP-complete language

L′ via f

I show that f is poly-time computableI show that if w ∈ L′ then f (w) ∈ LI show that if w 6∈ L′ then f (w) 6∈ L

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 6 / 43

Page 7: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Boolean Formulas and SAT

A Boolean formula is an expression involving Boolean variables andoperations.

φ = (x ∧ y) ∨ (x ∧ z)

Definition 5 (satisfiable formula)

A formula is satisfiable, if some assignment of 0s and 1s to the variablesmakes the formula evaluate to 1.

The formula φ = (x ∧ y) ∨ (x ∧ z) is satisfiable by the assignment

x = 0y = 1z = 0

The language of satisfied formulas:

SAT = {〈φ〉 : φ is a satisfiable Boolean formula}

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 7 / 43

Page 8: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Conjunctive Normal Form

It is useful to consider a special version of SAT

I A literal is a variable or negated variable: x or x .

I A clause is several literals joined by ∨s: (x1 ∨ x2 ∨ x3)

I A Boolean formula is in conjunctive normal form (CNF) if it consists ofclauses, connected with ∧s.

For example: (x1 ∨ x2 ∨ x3 ∨ x4) ∧ (x3 ∨ x5 ∨ x6) ∧ (x3 ∨ x6)

Definition 6A Boolean formula is in k-CNF form, if it is a CNF formula, and all clauseshave k literals.

I Example of 3CNF: (x1 ∨ x2 ∨ x3) ∧ (x3 ∨ x5 ∨ x6) ∧ (x3 ∨ x6 ∨ x4)

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 8 / 43

Page 9: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

CSAT and 3SAT

I SAT = {〈φ〉 : φ is a satisfiable Boolean formula}I CSAT = {〈φ〉 : φ is a satisfiable CNF formula}I 3SAT = {〈φ〉 : φ is satisfiable 3CNF formula}.

I Are these all NP-complete?

I Will soon show the Cook-Levin theorem: SAT is NP-complete!I Can slightly modify proof to show CSAT ∈ NPC ! (take home

exercise :-))I Hence, to prove that 3SAT ∈ NPC, it suffices to prove that

CSAT ≤P 3SAT.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 9 / 43

Page 10: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Section 2

CSAT vs. 3SAT

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 10 / 43

Page 11: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

CSAT ≤P 3SAT

I The reduction maps CNF formulae to 3CNF ones “clause by clause”.

I A clause with d ≤ 3 literals is mapped to equivalent clause with 3 literals.

(x1 ∨ x2) 7−→ (x1 ∨ x2 ∨ x2)

I A clause with d > 3 literals is mapped to d − 2 clauses, built on theoriginal literals together with (d − 3) new variables.

φ = (x1 ∨ x2 ∨ x3 ∨ x4 ∨ x8) 7−→φ3 = (x1 ∨ x2 ∨ y1) ∧ (y1 ∨ x3 ∨ y2) ∧ (y2 ∨ x4 ∨ x8)

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 11 / 43

Page 12: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

The reduction works!

Claim 7φ has a satisfying assignment iff φ3 does.

Proof’s idea: (for case d > 3)⇐ Given a satisfying assignment for φ3, use the settings of the xi ’s to getsatisfying assignment for φ. Why does it work? For each set of clauses thatcame from a clause in φ, note that each yi sets exactly one clause to true.There are k − 2 clauses but only k − 3 yi ’s. So at least one clause needs tobe satisfied by one of the xj or xj literals. Set this literal to true in φ.

⇒ An assignment satisfying φ, makes at least one literal per clause happy. Inthe “φ3 clause” of this literal the new variables are under no constraints. Usethe d − 2 new variables to set the remaining d − 2 clauses to “true”.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 12 / 43

Page 13: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

CSAT ≤P 3SAT, cont.

φ = (x1 ∨ x2 ∨ x3 ∨ x4 ∨ x8) 7−→φ3 = (x1 ∨ x2 ∨ y1) ∧ (y1 ∨ x3 ∨ y2) ∧ (y2 ∨ x4 ∨ x8)

I Doing the above mapping to each clause of a CNF formula, we get a3CNF that is satisfied iff the original one is.

I Since this mapping is polynomial time (?), we get CSAT ≤P 3SAT. ♣.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 13 / 43

Page 14: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Section 3

Clique

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 14 / 43

Page 15: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

3SAT ≤P CLIQUE

CLIQUE = {〈G, k〉 : G is an undirected graph with a k -clique}

Claim 83SAT ≤P CLIQUE.

Since CLIQUE ∈ NP, it follows that CLIQUE ∈ NPC.

Proof’s idea: We’ll construct a poly-time reduction f that maps 3CNF formulaeφ to pairs 〈G, k〉 of graphs and numbers.

The function f will have the property that φ is satisfiable, iff G has a clique ofsize k .

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 15 / 43

Page 16: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Proving 3SAT ≤P CLIQUE

On input φ, a 3CNF formula, the mapping reduction is defined as follows:

let k be the number of clauses in φ.

We construct a graph G = G(φ), see below, and output (G, k).

The graph G is defined as follows:

I Nodes in G are organized into triples t1, . . . , tk .

I Each triple corresponds to a clause of φ

I Each node in a triple corresponds to a literal in corresponding clause.

Ongoing example:

(x1 ∨ x2 ∨ x3) ∧ (x3 ∨ x5 ∨ x6) ∧ (x3 ∨ x6 ∨ x4)

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 16 / 43

Page 17: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Nodes of G

φ =(x1 ∨ x2 ∨ x3) ∧ (x3 ∨ x5 ∨ x6) ∧ (x3 ∨ x4 ∨ x6)

Add a node per literal

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 17 / 43

Page 18: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Edges of G

Add edges between all vertex pairs, exceptI within same tripleI between contradictory literals (e.g., x3 and x3)

φ = (x1 ∨ x2 ∨ x3) ∧ (x3 ∨ x5 ∨ x6) ∧ (x3 ∨ x4 ∨ x6)

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 18 / 43

Page 19: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

φ ∈ 3SAT =⇒ 〈G, k〉 ∈ CLIQUE

Proof: Suppose φ is satisfiable by an assignment ψ.With respect to ψ:

I At least one literal is assigned to 1 in every clause (?)I Select a 1-literal in every tuple;

These literals can be joined by edges (?)

Yielding a k -clique in G. ♣♣

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 19 / 43

Page 20: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

〈G, k〉 ∈ CLIQUE =⇒ φ ∈ 3SAT

Proof: Suppose G has a k -clique.

I No two of the cliques nodes are in the same triple. (?)I G has 3k vertexes and k clauses, so each triple has exactly one clique

node.I Assign 1 to each node in clique;

Assignment has no contradictions (?)

Yielding a satisfying assignment to φ.

♣Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 20 / 43

Page 21: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Recap

I We’ve constructed a poly-time computable function f .

I We saw that f has the property that φ ∈ 3SAT iff f (φ) ∈ CLIQUE.

I Therefore, f is a poly-time reduction from 3SAT to CLIQUE

=⇒ 3SAT ≤P CLIQUE. ♣

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 21 / 43

Page 22: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Section 4

SAT is NP-Complete

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 22 / 43

Page 23: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

SAT ∈ NPC

Theorem 9 (Cook-Levin, early 70s)

SAT ∈ NPC.

Proof’s idea:I Encode all information about whole history of computation as a (large

but polynomial) set of clauses, where settings of variables give you allinformation about the history.

I e.g., variables for each (tape cell, time step) telling you whether thetape head is there, and what is written

I Each step of computation changes only very local information (onlyvariables near the tape head). All other information must stay the same.

I if tape head not on my tape cell at time i , then I must stay the sameat time i + 1

I if tape head is on my tape cell, then my contents change accordingto δ

I Verifying that a computation history is "legal" involves only local checks(a lot of them, but only polynomial)

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 23 / 43

Page 24: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

SAT ∈ NPC

Theorem 10 (Cook-Levin, early 70s)

SAT ∈ NPC.

Proof’s idea:

I Suppose L ∈ NP and let N = (Q,Σ, Γ, δ,q0,qa,qr ) be an nc-time NTMthat accepts L.

I Given the string w ∈ {0,1}∗, construct in time O(|w |2c) a formula φN,wsuch that: φN,w ∈ SAT iff N accepts w .

I Hence, the mapping w 7→ φN,w is a poly-time reduction from L to SAT,establishing L ≤P SAT.

I In the following fix L, N and w ∈ {0,1}n.

I We assume wlg. that δ(qr , ·) = ∅.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 24 / 43

Page 25: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

The Configuration-History Tableau

Consider the nc-by-nc Tableau that describes a possible acceptingcomputation history of N on input w .

cell[1,1]

cell[1,t(n)]

q 0 0 10 0 . . .

1 2 3 . . . t(n)

0 0

0

1

I First row represents initial configuration of N on input w .I i ’th row represents the i-th configuration in a possible computation of N

on input w .

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 25 / 43

Page 26: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Some interesting variables telling us the contents of the tape atany particular time

How do we encode the contents of the tape cell j at time i?

I How about "let xi,j = s"? Problem: NOT BOOLEAN!

I WHAT WE DO: Let xi,j,s = 1 iff j th cell contains s at time i

I What if the tape head is there too? Let’s use an extra cell: state of tapehead inserted to the left of the cell that it is sitting on.

Note that for each i , j , exactly one xi,j,s should be set to 1. Not verycompressed, but still polynomial!

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 26 / 43

Page 27: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

The formula φN,w

I Let S = Q ∪ Γ (the alphabet of the configuration history).

I φN,w uses Boolean variables {xi,j,s}i,j∈[nc ],s∈S.

φN,w = φCell(N) ∧ φStart(w) ∧ φMove(N) ∧ φAccept(N)

I Given an assignment z for φN,w , let T (z) be the nc × nc Tableau, definedby setting the j-th cell in i ’th configuration to s, if xi,j,s = 1 in z.

(T (z) is undefined, if xi,j,s′ = xi,j,s = 1 for some s 6= s′ ∈ S, or xi,j,s = 0for all s ∈ S).

I T (z) will represents a (possible) accepting execution of N(w), iff z is ana satisfying assignment for φN,w .

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 27 / 43

Page 28: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

The formula φCell(N)

φCell(N) guarantees that the variables encode legal configurations:

I Each cell (i , j) has at least one letter:∨

s∈S xi,j,s.

I No cell (i , j) has two or more letters∧

s 6=s′∈S xi,j,s ∧ xi,j,s′ .

Together:

φCell(N) =∧i,j

(∨s∈S

xi,j,s

)∧

∧s 6=s′∈S

xi,j,s ∧ xi,j,s′

Claim 11If an assignment z satisfies φCell(N), then T (z) is defined.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 28 / 43

Page 29: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

The formula φStart(w)

φStart(w) guarantees that the first row encodes the initial configuration (i.e.,q0w).

φ start(w) =x1,1,q0 ∧ x1,2,w1 ∧ x1,3,w2 ∧ . . . ∧ x1,n+1,wn

∧ x1,n+2, ∧ . . . ∧ x1,nc ,

Claim 12If z satisfies φCell(N) ∧ φStart(w), then the first line of T (z) is q0w t . . .t︸ ︷︷ ︸

nc−n−1

.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 29 / 43

Page 30: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

The formula φMove(N)

φMove(N) is the “heart” of φN,w . To construct it, we employ locality ofcomputations.

Observation: Configuration C, with head location h, yields configuration C′

(with respect to δ), if the following holds.

I C′i =Ci for any i /∈ {h − 1,h,h + 1}I C′h−1,h,h+1 is consistent (with respect to δ) with Ch−1,h,h+1.

We check that each configuration in T (z) yields the next one, by inducinglocal “checks” on z.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 30 / 43

Page 31: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

φMove(N) – Rectangles

A rectangle is a 2× 3 configuration sub-table.

Assume thatδ(q1,a) = {(q1,b,R)} and δ(q1,b) = {(q2, c,L), (q2,a,R)}.

I (some) Legal 2× 3 rectangles:

a q1 b a q1 b a a q1q2 a c a a q2 a a b

a b a b b b a a ba b q2 c b b a a b

I (some) Illegal 2× 3 rectangles:

a b a a q1 b b q1 ba a a q1 a a q2 b q2

The set of legal moves are a constant, determined by δ!

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 31 / 43

Page 32: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

φMove(N) – Characterizing legal rectangles

The formula “verifies" that all 2× 3 rectangles in the Tableau are in the list C:

1. a b c∗ b ∗

2.a q bq’ a b’

a q ba b’ q’

(L,q′,b′) ∈ δ(q,b) (R,q′,b′) ∈ δ(q,b)

3. q ∗ ∗∗ ∗ ∗

∗ ∗ q∗ ∗ ∗

• Some rectangles in C are clearly illegal.

• For rectangles on the left-most and right-most side of Tableau, we useslightly different first type rectangles.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 32 / 43

Page 33: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

φMove(N)– formal definition

I For each entry (i , j) ∈ [nc ]× [nc ] and c ∈ C, let φMove,i,j,c be the formulataking the value 1 iff the 2× 3 table of cells in the Tableau whoseupper-left corner is (i , j) is c.

For instance, for entry (1,1) and c =a q1 bq2 a d ,

let φMove,1,1,c = x1,1,a ∧ x1,2,q1 ∧ x1,3,b ∧ x2,1,q2 ∧ x2,2,a ∧ x2,3,d

I Finally, let φMove(N) =∧

(i,j)∨

c∈C φMove,i,j,c .

Claim 13If z satisfies φCell(N) ∧ φStart(w) ∧ φMove(N), then T (z) is a possible configurationhistory of N(w).

Proof: By induction on the row index. Base case: z satisfies φCell(N) ∧φStart(w).Assume configuration defined in rows 1, . . . , i is possible and head is in cell j .The configuration of rows 1, . . . , i + 1 is also possible: Cells of indices not in{j − 1, j , j + 1}, by first type of rectangles in C. Other cells, by second typerectangles in C. Q: Why de we need the third type of cells?

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 33 / 43

Page 34: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

The formula φAccept(N)

φAccept(N) guarantees that some row encodes an accepting configuration ( i.e.,uqav ):

φAccept(N) =∨i,j

xi,j,qa

Claim 14If z satisfies φN,w = φCell(N) ∧ φStart(w) ∧ φMove(N) ∧ φAccept(N), then T (z) is anaccepting configuration history of N(w).

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 34 / 43

Page 35: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Correctness of reduction

I The transformation w 7→ φN,w is computable in time O(n2c).

I An assignment satisfying φN,w , corresponds to an acceptingconfiguration history of N(w).

I An accepting configuration history of N(w) corresponds to anassignment satisfying φN,w . (?)

Therefore, N accepts w iff φN,w ∈ SAT. ♣.

I For complete details, consult Sipser chapter 7.4.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 35 / 43

Page 36: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Section 5

Summary so far

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 36 / 43

Page 37: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Summary so Far

I We have seen that SAT and CSAT are NP-complete.

I CSAT ≤P 3SAT

I 3SAT ≤P CLIQUE

I CLIQUE ≤P IND-SET

I Hence, all of the above languages are NP-complete

I Full list of NP-complete languages contains thousands of knownNP-complete problems (from combinatorics, operation research, VLSIdesign, computational geometry, bioinformatics, . . . ).

I NP-completeness of new and of old problems is still established thesedays.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 37 / 43

Page 38: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Chains of reductions: NPC languages

CSAT

IntegerProg 3SAT

Clique

IndepSet

VertexCover

SetCover

3ExactCover

Knapsack

Scheduling

Subset-Sum

HamPath

HamCircuit

TRAVELING-SALESMAN

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 38 / 43

Page 39: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Why all the fuss about decision problems?

Don’t we want to find the satisfying assignment?

Given an oracle for the decision problem, show that you can find anassignment in poly time!

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 39 / 43

Page 40: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Beyond NP-completeness?

Exciting ideas to come in Computational Complexity!!

e.g., you will learn to understand a statement like "Super-Mario Brothers isPSPACE-complete"!

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 40 / 43

Page 41: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Section 6

Concluding Remarks

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 41 / 43

Page 42: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

Ladies and Gentlemen, Boys and Girls

We have just ended the third part of the course:Introduction to Computational Complexity (no more).

And with it, naturally, we’ve ended the whole course.

We hope you have enjoyed your flight, and look forward to meeting you in thefuture (but not in Moed B :-).

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 42 / 43

Page 43: Computational Models — Lecture 131tau-cm2016b.wdfiles.com/local--files/course-schedule/NP3.pdf · Computational Models — Lecture 131 Handout Mode Ronitt Rubinfeld and Iftach Haitner

The dreaded exam

I All material covered in class and recitations, from all parts of course.

I Five “open” questions.

I You can bring and use two double sided A4 (normal size) pagesmarked with your name.

I See website for more info.

I Piece of cake.

Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 13 June 6/8, 2016 43 / 43