- 40 Views
- Uploaded on
- Presentation posted in: General

L is in NP means: There is a language L ’ in P and a polynomial p so that

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

L is in NP means:

There is a language L’ in P and a polynomial p so that

L1≤L2 means:

For some polynomial time computable map r :

x: x L1iffr(x) L2

L is NP-hard means:

L’ NP: L’ ≤L

L is in NPC means:

LNP and L is NP-hard

Lemma: If L1 is NP-hard and L1 ≤ L2 then L2 is NP-hard.

f: {false, true}n {false,true}

Example: XOR(x1, x2) = x1 x2

XOR(true , true) = false

In this course 0=false, 1=true.

XOR(1,1)=0

Tables.

Formulae.

4

More compact representation as Boolean String: “0110”.

A function f: {0,1}n {0,1} can be represented as a table using …

……..2n bits

5

X1, X2, …, Xn are formulae.

If f is a formula then f is a formula.

If f1 and f2 are formulae then (f1) ∧ (f2) and (f1) ∨ (f2) are formulae.

Sometimes we leave out parentheses….

6

“(x1∧x2) ∨ (x2∧x1)” represents the function XOR.

Sometimes formula-representation is much more compact than table representation. Sometimes not.

It’s never much less compact.

7

f(x1, x2) = x1 x2

DNF: f(x1, x2) = (x1∧ ¬x2) ∨ (x2∧ ¬x1)

CNF: f(x1, x2) = (¬x1∨¬x2) ∧ (x1∨ x2)

A CNF is anyconjunction of clauses (disjunctions of literals). A DNF is anydisjunction of terms (conjunctions of literals).

Any function on n variables canbedescribed by a CNF (DNF) formulacontaining at most 2nclauses (terms), eachcontaining at most nliterals.

SAT: Given a Boolean function in CNF representation, is there a way to assign truth values to the variables so that the function evaluates to true?

SAT: Given a CNF, is it true that it does not represent the constant-0 function?

Input: (¬x1∨ ¬x2) ∧ (x1∨ x2)

Output: Yes.

Input: (¬x1∨ ¬x2) ∧ (x1∨ x2) ∧ (x1∨ ¬x2 ) ∧ (¬x1∨ x2)

Output: No.

SAT is in NP.

Cook’s theorem (1972): SAT is NP-hard.

A circuit C is a directed acyclic graph.

Nodes in C are called gates.

Types of gates:

Variable (or input) gates of indegree 0, labeled X1, X2, …Xn

Constant gates of indegree 0, labeled 0,1

AND-, OR-gates of indegree 2,

NOT-, COPY-gates of indegree 1.

m distinguished gates are output gates.

The circuit C computes a Boolean function

C: {0,1}n {0,1}m

f(X1, X2, X3) = ¬X1∨(X1∧X2∧X3)

⋁

⋀

⋀

¬

X3

X2

X1

X1

f(X1, X2, X3) = ¬X1∨(X1∧X2∧X3)

⋁

⋀

⋀

¬

X3

X2

X1

Convention: For each j, at most gate is labeledXj

Not quite!

Given a circuit, we can write down an equivalent formula, but in may become much bigger.

A circuit is allowed to reuse the result of a sub-computation without doing the computation again!

Any functionf: {0,1}n {0,1}m is represented by somecircuit.

Proof:

Any functionf: {0,1}n {0,1} canbedescribed by a Booleanformula.

A formulacanalsobeviewed as a circuit.

Combinemsuchcircuits.

Proof of Cook’s theorem:

CIRCUIT SAT is NP-hard.

CIRCUIT SAT reduces to SAT.

Hence, SAT is NP-hard.

CIRCUIT SAT: Given a Boolean circuit, is there a way to assign truth values to the input gates, so that the output gate evaluates to true?

Generalizes SAT, as CNFs are formulas and formulas are circuits.

⋁

Input:

⋀

Output: Yes

¬

⋀

X3

X2

X1

⋀

Input:

⋀

Output: No

¬

⋀

X3

X2

X1

Proof of Cook’s theorem:

CIRCUIT SAT is NP-hard.

CIRCUIT SAT reduces to SAT.

Hence, SAT is NP-hard.

We first prove CIRCUIT SAT reduces to SAT

Weconsider Circuits also as computationaldevicesthemselves.

LikeTuring Machines, circuitsC: {0,1}n {0,1} solvedecision problems on {0,1}n.

UnlikeTuringmachines, circuitstakes inputs of afixedinput lengthnonly.

Given Turing Machine M running in time at most p(n)≥n on inputs of length n, where p is a polynomial.

For every n, there is a circuit Cn with at most O(p(n)2) gates so that

∀x∈ {0,1}n: Cn(x)=1 iffM accepts x.

The map 1nCn is polynomial time computable.

Intuition behind proof

Flip-Flop, stores one bit.

Time t

…

Time 1

Can be replaced by

acyclic Boolean

circuit of size ≈ s

1

2

s

Time 0

Given a Turing Machine computation, an integer t and an integer i let cti {0,1}s be a Boolean representation of the following information, a cell state vector:

The symbol in cell i at time t

Whether or not the head is pointing to cell i at time t

If the head is pointing to cell i, what is the state of the finite control of the Turing machine at time t?

The integer s depends only on the Turing machine (not the input to the computation, nor t,i).

To make cti defined for all t, we let c(t+1)i = cti if the computation has already terminated at time t.

If we know the Turing machine and

ct-1,i-1, ct-1,i, ct-1, i+1, we also can determine ct,i.

In other words, there is a Boolean function h depending only on the Turing machine so that ct,i = h(ct-1,i-1, ct-1,i, ct-1,i+1).

A circuit D for h is the central building block in a circuit computing all cell state vectors for all times for a given input.

t(n)

x1

xn

2 t(n)