nondeterminis c tms ntm defini ons
play

Nondeterminis+c TMs NTM defini*ons Same as determinis+c - PowerPoint PPT Presentation

Nondeterminis+c TMs NTM defini*ons Same as determinis+c TM, but ( q,a ) is a finite set of possible next transi*ons E.g., ( q,a ) = { ( q


  1. Nondeterminis+c ¡TMs ¡

  2. NTM ¡defini*ons ¡ • Same ¡as ¡determinis+c ¡TM, ¡but ¡δ( q,a ) ¡is ¡a ¡finite ¡ set ¡ of ¡possible ¡next ¡transi*ons ¡ ¡ • E.g., ¡ ¡δ( q,a ) ¡= ¡{ ¡( q 1 ,b 1 ,D 1 ), ¡( q 2 ,b 2 ,D 2 ), ¡... ¡( q r ,b r ,D r )} ¡ – cannot ¡write ¡ b 1 , ¡ go ¡in ¡direc+on ¡ D 2 , ¡etc. ¡ ¡ • NTM ¡ N ( w ) ¡accepts ¡iff ¡there ¡exists ¡a ¡finite ¡ sequence ¡of ¡choices ¡that ¡result ¡in ¡an ¡accep+ng ¡ state. ¡ • N(w) ¡may ¡have ¡choice ¡sequences ¡that ¡never ¡ halt, ¡yet ¡s+ll ¡accept ¡ w . ¡

  3. NTM ¡variants ¡ • Bells ¡and ¡whistles ¡do ¡not ¡increase ¡NTM ¡power ¡ • if ¡ L ¡is ¡accepted ¡by ¡a ¡ k-­‑ tape ¡mul+dimensional ¡... ¡ NTM, ¡then ¡ L ¡is ¡accepted ¡by ¡standard ¡1-­‑tape ¡NTM ¡ • Henceforth, ¡assume ¡ NTM s ¡ are ¡standard-­‑issue. ¡

  4. Theorem: ¡ ¡NTM ¡  ¡DTM ¡ Theorem: ¡ ¡If ¡L ¡is ¡accepted ¡by ¡a ¡NTM, ¡then ¡L ¡is ¡ also ¡accepted ¡by ¡a ¡DTM. ¡ ¡ ¡ ¡i.e., ¡languages ¡accepted ¡by ¡ NTMs ¡are ¡just ¡the ¡ r.e. ¡languages. ¡ ¡(Those ¡accepted ¡by ¡DTMs) ¡ Again, ¡we ¡see ¡that ¡DTMs ¡are ¡a ¡robust ¡model ¡

  5. Simula*on ¡ • Let ¡ N ¡be ¡a ¡NTM, ¡create ¡ M ¡to ¡simulate ¡ N ¡ • Problems: ¡ ¡unlike ¡other ¡simula+ons, ¡ M ¡cannot ¡ keep ¡track ¡of ¡ ¡ – states ¡ – head ¡posi+on ¡ – tape ¡contents ¡ Because ¡different ¡possible ¡computa+ons ¡have ¡ different ¡states, ¡head-­‑posi+ons, ¡tape ¡contents ¡ SOLUTION: ¡ ¡ M ¡tries ¡ every ¡possible ¡computa+on ¡

  6. Bounded ¡Nondeterminism ¡ • N ¡has ¡only ¡a ¡finite ¡number ¡of ¡choices ¡at ¡each ¡ step. ¡ • Let ¡ r ¡= ¡maximum ¡number ¡of ¡choices ¡for ¡any ¡ transi+on. ¡ ¡ ¡ r ¡= ¡max q,a ¡|δ N ( q,a )| ¡ • WLOG ¡assume ¡ all ¡transi+ons ¡have ¡ r ¡choices. ¡ • Possible ¡runs ¡of ¡ N ¡can ¡be ¡viewed ¡as ¡ r -­‑ary ¡tree: ¡

  7. Possible ¡computa*ons ¡of ¡N(w) ¡ ID 0 ¡= ¡$ q 0 w ¡ r ¡branches ¡ First ¡move ¡ . ¡ . ¡ . ¡ . ¡ ID 1 ¡ ID 2 ¡ ID 3 ¡ ID 4 ¡ ID r ¡ consequence ¡of ¡ taking ¡4 th ¡ . ¡. ¡. ¡ applicable ¡ ID 11 ¡ ID 1 r ¡ ID 42 ¡ . ¡. ¡. ¡ ID r1 ¡ ID rr ¡ transi+on ¡ ID 425 ¡ State ¡of ¡ N ’s ¡computa+on ¡aaer ¡ ¡ ID 4251 ¡ taking ¡ ¡ ¡4 th , ¡2 nd , ¡5 th , ¡1 st , ¡9 th ¡choices ¡ ¡ on ¡first ¡five ¡transi+ons ¡ ID 42519 ¡

  8. If ¡N(w) ¡accepts, ¡it ¡does ¡so ¡in ¡finite ¡*me ¡ • = ¡s ¡steps, ¡for ¡some ¡ s ¡ ¡ (different ¡for ¡different ¡ w ) ¡ • Some ¡sequence ¡of ¡ s ¡nondet ¡choices ¡accept ¡ • Can ¡represent ¡the ¡choices ¡as ¡an ¡ r -­‑ary ¡ sequence ¡with ¡ s ¡places: ¡ ¡ a 1 a 2 ...a s ¡ where ¡each ¡ a i ¡ is ¡in ¡{1,2,..., r } ¡ • M ¡tries ¡every ¡possible ¡sequence, ¡of ¡all ¡ possible ¡lengths ¡ • M ¡essen+ally ¡does ¡a ¡breadth-­‑first ¡search ¡of ¡ the ¡tree ¡of ¡possible ¡computa+ons ¡of ¡ N. ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ (why ¡not ¡DFS?) ¡

  9. M ¡has ¡three ¡tapes ¡ Tape ¡1 ¡ $ ¡ w ¡ Holds ¡input; ¡ ¡never ¡changes ¡ Holds ¡ N ’s ¡computa+on ¡for ¡ Tape ¡2 ¡ $ ¡ some ¡possible ¡computa+on ¡ dictated ¡by ¡choices ¡on ¡tape ¡3 ¡ Holds ¡ r-­‑ ary ¡sequence ¡to ¡ Tape ¡3 ¡ $ ¡ 3 ¡ 7 ¡ 4 ¡ control ¡ N’s ¡ choices ¡

  10. Genera*on ¡of ¡choice ¡sequences ¡ • M ¡ uses ¡subrou+ne ¡NewSeq ¡ to ¡generate ¡ r -­‑ary ¡ sequences ¡in ¡lexicographic ¡order ¡on ¡tape ¡3. ¡ • E.g., ¡if ¡ r ¡= ¡2, ¡then ¡lex. ¡order ¡is ¡ ¡ ¡ ¡1,2,11,12,21,22,111,112,121,122,... ¡ • If ¡NewSeq ¡is ¡called ¡with ¡112 ¡on ¡tape ¡3, ¡it ¡ would ¡replace ¡it ¡with ¡121. ¡

  11. M’s ¡Main ¡program ¡ Ini+alize ¡tape ¡3 ¡with ¡“1” ¡ Copy ¡(tape ¡1 ¡(input ¡ w ) ¡to ¡tape ¡2) ¡ WHILE ¡TRUE: ¡ ¡Simulate ¡ N ¡on ¡tape ¡2 ¡for ¡one ¡more ¡step; ¡ ¡ ¡ ¡/* ¡use ¡tape ¡3 ¡to ¡guide ¡choice ¡(details ¡follow) ¡ ¡IF ¡ N ¡accepts, ¡THEN ¡accept, ¡ELSE ¡forward ¡head ¡3 ¡ ¡IF ¡head ¡3 ¡scanning ¡blank ¡symbol ¡ ¡ ¡ ¡ ¡ ¡THEN ¡NewSeq ¡and ¡Copy ¡

  12. Simulate ¡ • If ¡ N ¡is ¡in ¡state ¡ q , ¡scanning ¡symbol ¡ a , ¡ ¡then ¡ execute ¡the ¡ n th ¡ transi+on ¡for ¡δ N ( q,a ) ¡for ¡ N , ¡ where ¡ n ¡is ¡symbol ¡scanned ¡on ¡tape ¡3. ¡ DETAIL: ¡ ¡ Suppose ¡ n th ¡ element ¡of ¡δ N ( q,a ) ¡= ¡( p,b,D ) ¡ ¡ ¡ In ¡ M, ¡ ¡ ¡ ¡ δ M ( q,$,a,n ) ¡= ¡( p,$,b,n,S,D,R ) ¡ move ¡head ¡3 ¡to ¡ tape ¡1 ¡just ¡sits ¡ next ¡choice ¡ tape ¡2 ¡ ¡is ¡symbol ¡ N ¡scans ¡ move ¡tape ¡2 ¡as ¡ N ¡would ¡ tape ¡3 ¡ ¡dictates ¡ N ’s ¡choice ¡ change ¡tape ¡2 ¡as ¡ N ¡would ¡

  13. Why ¡it ¡works ¡ • M ¡runs ¡ N ¡ ¡(over ¡and ¡over ¡and ¡over....) ¡for ¡longer ¡ and ¡longer ¡sequences ¡of ¡nondet ¡choices ¡ • If ¡N(w) ¡accepts, ¡then: ¡ • for ¡some ¡ s , ¡there ¡is ¡a ¡sequence ¡of ¡ s ¡nondeterminis+c ¡ choices ¡that ¡causes ¡ N ¡to ¡accept. ¡ • eventually, ¡ M ¡will ¡produce ¡that ¡sequence ¡on ¡tape ¡3, ¡and ¡ simulate ¡the ¡accep+ng ¡computa+on ¡on ¡tape ¡2, ¡and ¡accept ¡ • If ¡ N(w) ¡doesn’t ¡accept, ¡then: ¡ • there ¡is ¡no ¡sequence ¡of ¡choices ¡that ¡cause ¡ N ¡ to ¡accept. ¡ • regardless ¡of ¡what ¡sequence ¡is ¡used, ¡ M ¡will ¡not ¡accept ¡ • M ¡will ¡just ¡run ¡forever, ¡hence ¡not ¡accept ¡ w ¡

  14. Ques*ons ¡ • If ¡ N ¡halts ¡and ¡rejects ¡for ¡some ¡sequence ¡of ¡ choices, ¡what ¡does ¡ M ¡do? ¡ ¡Why? ¡ • If ¡ N ¡runs ¡in ¡ k ¡steps, ¡roughly ¡how ¡many ¡steps ¡ does ¡ M ¡take? ¡

  15. Nondeterminis*c ¡Complexity ¡ DEF: ¡ ¡A ¡NTM ¡N ¡ is ¡ T(n) ¡+me ¡bounded ¡iff ¡for ¡ ¡ every ¡ n , ¡for ¡every ¡input ¡ w ¡of ¡size ¡ n , ¡and ¡for ¡ ¡ every ¡possible ¡sequence ¡of ¡nondeterminis+c ¡ choices, ¡ N(w) ¡ halts ¡within ¡ T(n) ¡transi+ons. ¡

  16. Nondeterminis*c ¡Complexity ¡Classes ¡ N+me( T(n) ) ¡= ¡ ¡ ¡ ¡{ L ¡| ¡exists ¡a ¡ T(n) ¡+me-­‑bounded ¡NTM ¡ ¡ ¡ ¡ ¡ ¡accep+ng ¡ L } ¡ Nspace( S(n) ) ¡= ¡ ¡ ¡ ¡{ L ¡| ¡exists ¡a ¡ S(n) ¡space-­‑bounded ¡NTM ¡ ¡ ¡ ¡ ¡ ¡accep+ng ¡ L } ¡ Tape ¡reduc+on, ¡linear ¡speed-­‑up, ¡+me ¡& ¡space ¡hierarchies ¡ analagous ¡to ¡determinis+c ¡+me ¡& ¡space ¡complexity ¡ ¡

  17. D*me ¡vs ¡N*me ¡ • D+me( f(n) ) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡N+me( f(n) ) ¡ ⊂ – why? ¡ • N+me( f(n) ) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡D+me(2 O( f(n) ) ) ¡ ⊂ – why? ¡ ¡ Savitch’s ¡Theorem: ¡ ¡ ¡Nspace( f(n) ) ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Dspace( f(n) 2 ) ¡ ¡ ⊂

  18. and ¡finally, ¡we ¡define.... ¡ NP ¡= ¡ ¡ ¡ ¡ N+me( n k ) ¡ ¡ ¡ ¡ ∪ k ¡≥ ¡0 ¡ “Nondeterminis+c ¡Polynomial ¡Time” ¡ ¡Union ¡over ¡all ¡polynomials ¡ p ¡of ¡N+me( p ( n ))) ¡

  19. P ¡ ¡vs. ¡NP ¡ NP ¡ P ¡ Million-­‑dollar ¡ques+on: ¡ ¡Does ¡P ¡= ¡NP ¡? ¡

  20. Why ¡we ¡care ¡ • Languages ¡corresponding ¡to ¡hundreds ¡of ¡ op+miza+on ¡problems ¡are ¡easily ¡in ¡NP, ¡ unknown ¡if ¡in ¡P ¡ • If ¡P ¡= ¡NP, ¡internet ¡security ¡would ¡fail ¡

  21. Decision ¡problems ¡revisited ¡ • Many ¡op+miza+on ¡problems ¡can ¡be ¡reposed ¡ as ¡decision ¡problems. ¡ ¡ ¡ • TSP: ¡ ¡Given ¡complete ¡undirected ¡graph ¡with ¡ edge ¡weights, ¡find ¡a ¡tour ¡(simple ¡cycle ¡visi+ng ¡ each ¡vertex ¡once) ¡of ¡minimum ¡total ¡weight. ¡ • TSP dec : ¡ ¡{< G ># k ¡| ¡ G ¡is ¡a ¡complete ¡undirected ¡ graph ¡with ¡edge ¡weights ¡and ¡there ¡exists ¡a ¡ tour ¡of ¡total ¡weight ¡≤ ¡ k ¡ } ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend