370 likes | 654 Views
Non-deterministic time. [AB 2]. Non-deterministic Turing Machines. Excluding “ _ ”. and _. q reject q accept. 3. The accepted language. Def: A Non-deterministic Turing machine (NDTM) accepts L iff there exists a path from an initial configuration to an accepting configuration
E N D
Non-deterministic time [AB 2]
Non-deterministic Turing Machines Excluding “_” and _ qrejectqaccept 3
The accepted language Def: A Non-deterministic Turing machine (NDTM) accepts L iff there exists a path from an initial configuration to an accepting configuration In particular if it rejects x, there is no path from an initial configuration to an accepting configuration in the configuration graph of x
Time complexity Def: The running time of a NDTM T on input x is the length of the longest path from an initial configuration to a terminating configuration. Def: A NDTM T runs in time f(n) if for every input x, the running time of T on x is at most f(|x|).
Examples • Perfect Matching – • Input G=(V,E). • Yes instances: G has a perfect matching. • No instances: G does not have a perfect matching. • MaxClique-atleast-k • Input G=(V,E),k. • Yes instances: G has a k-clique. • No instances: G does not have a k-clique.
What about • No Perfect Matching – • Input G=(V,E). • No instances: G has a perfect matching. • Yes instances: G does not have a perfect matching. • MaxClique-atmost-k • Input G=(V,E),k. • No instances: G has a k-clique. • Yes instances: G does not have a k-clique.
P, NP and co-NP coL= *-L coNP== {coL | LNP}
NP – second definition A language L belongs to NP if there exists • A polynomial p(n) • A polynomial time TM M Such that xLiff u {0,1}p(n) s.t. M(x,u)=1 Any u s.t. M(x,u)=1 is called a witness for xL
NP PSPACE Proof: • Suppose L belongs to NP, solvable by M(x,u). • Algorithm in PSPACE: Given x {0,1}n , try sequentially all u {0,1}p(n) and accept iff for some u, M(x,u)=1.
SIP 254-259, AB 2.3 Cook/Levin
Tableaux cne
M,xvariables cne
SIP 259-260 CNF is NPC
CNF3CNF (xy)(x1x2... xt)... clauses with 1 or 2 literals clauses with more than 3 literals replication split (xyx) (x1 x2 c11)(c11 x3 c12)... (c1t-3 xt-1xt)
3SATL CLIQUE 001 010 111 101
SIP 251-253 SATp CLIQUE: proof