Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Class 24: Halting Problems

David Evans
November 29, 2016
7.9k

Class 24: Halting Problems

cs2102: Discrete Mathematics
University of Virginia, Fall 2016

See course site for notes:
https://uvacs2102.github.io

David Evans

November 29, 2016
Tweet

Transcript

  1. Class  24:   Halting  Problems cs2102:  Discrete  Mathematics  |  F16

    uvacs2102.github.io   David  Evans   University  of  Virginia Albert  Mayo
  2. Plan Today: Undecidable  Problems Decidability  in  Theory  and  Practice Thursday:

    Number  Theory  and  Cryptography 1 Final  Preparation  Notes PSΩ  due  Sunday/Tuesday
  3. Turing  Machines  Recap 2 = (, ⊆  ×  Γ →

     ×  Γ  ×  ,  0 ∈ , 233456 ⊆ ) is  a  finite  set,   Γ is  finite  set  of  symbols, = {L,  R,  Halt} S R0 R1 X0 X1 Y0 Y1 Z0 Z1 B C 0*→*X,*R 1 →*1,*R 0*→*0,*R 1 →*1,*R +*→*+,*R 0*→*0,*R 1 →*1,*R 0*→*0,*R 1 →*1,*R =*+=,*R X →*X,*R X →*X,*R 0*→*X,*R 1 →*X,*R X →*X,*R X →*X,*R 0*→*X,*L 1*→*X,*L 0*→*0,*L 1 →*1,*L + →*+,*L =*→*=,*L X*→*X,*R =*→*=,*R Accep t $*→*$,*Halt
  4. 3 A  Turing  Machine,   = (, , 0 ,

    233456 ),  accepts  a  string,  ,  if   there  is  an  execution  of   that  starts  in  configuration,  (null, 0 , ),   and  terminates  in  a  configuration,  (, D , ),  where  D ∈ 233456.     An  execution of  a  Turing  Machine, = (, ⊆  ×  Γ →  ×  Γ  ×  ,  0 ∈ , 233456 ⊆ )   is  a  (possibly  infinite)  sequence  of  configurations,   0 , E , … , G  where   ∈ Tsil  ×    ×  List,  such  that  (1) 0 = (, 0 , ) and  (2)  all   Q → QRE  steps  are  valid  following  . A  Turing  Machine,   = (, , 0 , 233456 ), recognizes  a  language  ,   if  for  all  string   ∈ ,   accepts  ,  and  there  is  no  string   ∉ such   that   accepts  .
  5. Recap:  Cardinality  of  TM = (, ⊆  ×  Γ →

     ×  Γ  ×  ,  0 ∈ , 233456 ⊆ ) is  a  finite  set,   Γ is  finite  set  of  symbols, = {L,  R,  Halt}  computable  numbers ≤     = ℕ < ℝ Hence,  there  are  real  numbers  that  are  not  computable. Today:  let’s  find  one (and  understand  what  it  means).
  6. Proving  Recognizability How  can  we  prove  a  language  is  Turing-­‐recognizable?

    5 A  Turing  Machine,   = (, , 0 , 233456 ), recognizes  a  language  ,   if  for  all  string   ∈ ,   accepts  ,  and  there  is  no  string   ∉ such   that   accepts  .
  7. Proving  Un-­‐Recognizability How  can  we  prove  a  language  is  not

    Turing-­‐recognizable? 6 A  Turing  Machine,   = (, , 0 , 233456 ), recognizes  a  language  ,   if  for  all  string   ∈ ,   accepts  ,  and  there  is  no  string   ∉ such   that   accepts  .
  8. Decidability  and  Recognizability 7 A  Turing  Machine,   = (,

    , 0 , 233456 ), recognizes  a  language  ,   if  for  all  string   ∈ ,   accepts  ,  and  there  is  no  string   ∉ such   that   accepts . A  Turing  Machine,   = (, , 0 , 233456 ), decides  a  language  ,  if   for  all  string   ∈ ,   accepts  ,  and  for  all  strings   ∉,   terminates   in  a  non-­‐accepting  state.
  9. Decidability  and  Computability 8 A  Turing  Machine,   = (,

    , 0 , 233456 ), decides  a  language  ,  if   for  all  string   ∈ ,   accepts  ,  and  for  all  strings   ∉,   terminates   in  a  non-­‐accepting  state. “computability”  is  decidability  for  functions  – essentially  the  same  meaning
  10. Languages  and  Machines ∀ ∈ Σ∗, ∶=      h

     described  by                is  valid  TM  description RejectMachine                                        ℎ                                           qreject
  11. Self-­‐Rejecting  Language ℒ ≔ the  language  recognized  by   SelfRejecting

    ≔   ∈ Σ∗ ∉ ℒ  } ∶=  h  described  by                is  valid  TM  description RejectMachine                                        ℎ                                          
  12. Self-­‐Rejection  is  Self-­‐Defeating! SelfRejecting ≔   ∈ Σ∗ ∉ ℒ

     } Is  there  a  xy  =  (xy ) that  recognizes  SelfRejecting?
  13. Diagonalization  Proof e 0 1 00 01 10 11 000

    001 010 … M(e) ü ü ü ü … M(0) ü ü ü ü ü ü … M(1) ü ü ü M(00) M(01) ü ü ü M(10) ü M(11) M(000) ü ü ü ü ü ü ü ü ü ü ü … M(w) ü ü … Input Machine SelfRejecting ≔   ∈ Σ∗ ∉ ℒ  } Which  of  the  machines  are  in SelfRejecting?
  14. Diagonalization  Proof e 0 1 00 01 10 11 000

    001 010 … M(e) ü ü ü ü … M(0) ü ü ü ü ü ü … M(1) ü ü ü M(00) M(01) ü ü ü M(10) ü M(11) M(000) ü ü ü ü ü ü ü ü ü ü ü … M(w) ü ü … Input Machine SelfRejecting ≔   ∈ Σ∗ ∉ ℒ  } Where  is  z{|}~{•{€•‚ƒ„?
  15. An  Any  TM  Simulator Universal Turing Machine w x Result

     of running M(w) on  input  x Recall  from  Class  23:
  16. Accepting  Language 19 Is  †‡Turing-­‐recognizable? Sure,  the  Universal  TM  

    recognizes  it! Proof  sketch:  ‰Š < , > = (< , >) †‡ =   ,    accepts    }  
  17. Accepting  Language 20 Is  †‡Turing-­‐decidable? Does  the  recognizability proof  work?

    Proof  sketch:  ‰Š < , > = (< , >) †‡ =   ,    accepts    }  
  18. 22 No!  Proof  by  contradiction: Assume   = 2 decides

     †‡ . We  can  construct   = (Ž ) that  takes  input   and   simulates   ,  and  do  opposite:   233456 • =   − 233456 . †‡ =   ,    accepts    }  
  19. 23 No!  Proof  by  contradiction: Assume   = 2 decides

     †‡ . We  can  construct   = (Ž ) that  takes  input   and   simulates   ,  and  do  opposite:   233456 • =   − 233456 . †‡ =   ,    accepts    }   What  should   Ž do?
  20. †‡ is  Undecidable So,  D must  not  exist. But,  if

     H exists,  we  can  make  D. So,  H must  not  exist! But,  if  ATM is  decidable,  H must  exist. Thus,  ATM must  not  be  decidable. †‡ =   ,    accepts    }   < , > ≔ if  () accepts  ,  accept;  otherwise  reject. < > ≔ if    accepts  (, ),  reject;  otherwise,  accept. = Ž Ž =  ?
  21. Halting  Problem 25 †‡ =   ,    accepts  

     }   †‡ =   ,    terminates  on    }  
  22. Other  Undecidable  Languages 27 †‡ =   ,    accepts

       }   †‡ =   ,    terminates  on    }   3†‡ =   ,    enters  state  q•  on    }   Virus†‡ =      is  a  virus  }   Rice’s  Theorem:  basically,  any  interesting  “dynamic”  property  is  undecidable  
  23. Ali  G  Problem 30 ℒAliG ≔  ×   =  

     , ∈ 9 ∗, = }} Is  there  a  Turing  Machine  AliG  that  decides  ℒAliG?
  24. Charge Undecidable  languages: no  ideal  computer  can  always  decide real

     computers  often  can:   approximate,  only  solve  some  inputs Decidable  languages: for  ideal  computers,  always  decides for  real  computers,  real  inputs  matter