CSci 4011 Lecture 21 - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

CSci 4011 Lecture 21

Description:

A satisfying assignment is a setting of the variables that makes the formula true ... A Boolean formula is satisfiable if there exists a satisfying assignment for it ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 30
Provided by: nickh4
Category:
Tags: csci | formula | lecture

less

Transcript and Presenter's Notes

Title: CSci 4011 Lecture 21


1
CSci 4011
INHERENT LIMITATIONS OF COMPUTER PROGRAMS
2
TIME COMPLEXITY
Definition Let M be a TM that halts on all
inputs. The running time or time-complexity of M
is the function f N ? N, where f(n) is the
maximum number of steps that M uses on any input
of length n.
Definition TIME(t(n)) L L is a language
decided by a O(t(n)) time Turing Machine
3
IMPORTANT COMPLEXITY CLASS
P is the class of problems that can be solved in
polynomial time they are efficiently decidable
4
NON-DETERMINISTIC PROGRAMS
are just like standard programs, except
1. There is a special instruction, guess(), that
can return 0 or 1.
2. The program accepts an input if there exists a
list of guesses that make it accept.
3. The running time of the program is the maximum
number of steps that can be caused by calls to
guess().
5
L L is decided by a O(t(n))-time
non-deterministic Turing machine
Definition NTIME(t(n))
6
BOOLEAN FORMULAS
A satisfying assignment is a setting of the
variables that makes the formula true
(?x ? y) ? z
?
x 1, y 1, z 1 is a satisfying assignment
for ?
?(x ? y) ? (z ? ?x)
0
0
1
0
A Boolean formula is satisfiable if there exists
a satisfying assignment for it
SAT ? ? is a satisfiable Boolean formula
7
A 3cnf-formula is of the form
(x1 ? ?x2 ? x3) ? (x4 ? x2 ? x5) ? (x3 ? ?x2 ?
?x1)
(x1 ? ?x2 ? x1)
YES
(x3 ? x1) ? (x3 ? ?x2 ? ?x1)
NO
(x1 ? x2 ? x3) ? (?x4 ? x2 ? x1) ? (x3 ? x1 ?
?x1)
NO
(x1 ? ?x2 ? x3) ? (x3 ? ?x2 ? ?x1)
NO
3SAT ? ? is a satisfiable 3cnf-formula
8
3SAT ? ? is a satisfiable 3cnf-formula
Theorem 3SAT ? NP
On input ?
1. Check if the formula is in 3cnf
2. For each variable xi
a. Set temp guess.
b. Scan across ?, replacing xi with temp.
3. Test if the assignment satisfies ?
Total running time O(mn)
9
Theorem L ? NP if and only if there exists a
poly-time Turing machine V (for Verifier) with
L x ?y y poly(x) and V(x,y) accepts
Proof
  • If L x ?y y poly(x) and V(x,y)
    accepts
  • then L ? NP

Because we can guess y and then run V
(2) If L ? NP then L x ?y y poly(x)
and V(x,y) accepts
Let N be a non-deterministic poly-time TM that
decides L and define V(x,y) to accept if y is an
accepting computation history of N on x
10
3SAT
? ?y such that y is a satisfying assignment
to ? and ? is in 3cnf
V(?,y) Accept if ? is in 3cnf and ?(y) is true
? ?y such that y is a satisfying assignment
to ?
SAT
V(?,y) Accept if ? is a formula and ?(y) is
true
11
A language is in NP if and only if there exist
polynomial-length certificates for membership to
the language
SAT is in NP because a satisfying assignment is a
polynomial-length certificate that a formula is
satisfiable
12
HAMILTONIAN PATHS
13
HAMPATH ltG,s,tgt G is a directed graph with
a Hamiltonian path from s to t
Theorem HAMPATH ? NP
The Hamiltonian path itself is a certificate
14
K-CLIQUES
15
CLIQUE ltG,kgt G is an undirected graph with
a k-clique
Theorem CLIQUE ? NP
The k-clique itself is a certificate
16
SEARCHING FOR
A search problem is one where the answer is
more than a single bit, for example
if ltB,Ggt is a stable marriage problem,
the answer is a stable matching between
every boy and some girl.
If ltCgt is a CIRCUIT-SAT problem, the answer is
an input that makes the circuit output 1.
We can think of these problems as finding a
right answer.
17
NP all the search problems for which it is easy
to check if an answer is right.
18
EXAMPLES
FACTOR ltN,kgt N has a prime factor k .
SUBSET-SUM lty1,yn, tgt there exist
bits b1bn so that Si bi yi t .
FUSION ltSIM,1kgt SIM is a program that
simulates nuclear fusion reactor designs and has
an input of length at most k where energy output
gt energy input
19

P NP?

20
If P NP
Mathematicians would be out of a job
Cryptography as we know it would not be possible
We could determine if cold fusion is possible
We could determine if faster-than-light travel
is possible.
21
If P NP
We could find optimal circuits for any task
EQC ltC1,C2gt 8 x. C1(x) C2(x) 2 coNP
MIN-CIRCUIT ltCgt 8 C, C C or (C,C)
? EQC
If PNP, then EQC 2 P, so MIN-CIRCUIT 2 coNP P.
22
If P NP
Generation is as easy as recognition
Being a chef is as easy as eating.
Writing symphonies is as easy as listening to
them.
Writing Shakespeare is as easy as recognizing
Shakespeare.
In 40 years, no one has found a proof that P ?
NP.
23
POLY-TIME REDUCIBILITY
A language A is polynomial time reducible to
language B, written A ?P B, if there is a
polynomial time computable function S ? S,
where for every w,
w ? A ? (w) ? B
is called a polynomial time reduction of A to B
24
A
B


?w. w ? A ? (w) ? B
25
Theorem. If A P B and B 2 P, then A 2 P. (so
if A P B and A ? P, then B ? P.)
Proof. B ? P ?
sb-time program test_b(s) to decide B
A P B ?
wa-time function f s.t. f(w) ?B iff w ?A.
test_a(w) s f(w) return test_b(s)
TIME COMPLEXITY O(wab)
26
HARDEST PROBLEMS IN NP
Definition A language B is NP-complete if
1. B ? NP
2. Every A in NP is poly-time reducible to
B (i.e. B is NP-hard)
27
B is NP-Complete
28
Theorem. If B is NP-Complete, C2NP, and B P C,
then C is NP-Complete.
NP
P
C
B
29
Theorem. If B is NP-Complete and B 2 P, then
PNP.
Corollary. If B is NP-Complete, and P?NP,
there is no fast algorithm for B.
Write a Comment
User Comments (0)
About PowerShow.com