Title: Decidability
1Decidability
2- Why study un-solvability?
- When a problem is algorithmically unsolvable, we
realize that the problem must be simplified or
altered before we can find an algorithm solution - A glimpse of the unsolvable can stimulate your
imagination and help you gain an important
perspective on computation
3- Decidable problems concerning Regular languages
- ADFAltB,wgt B is a DFA that accepts w
- Thm
- ADFA is a decidable language
4- Proof
- MOn input ltB,wgt, where B is DFA
- and w is a string
- 1. Simulate B on input w
- 2. If the simulation ends in an accept state,
accept. - If it ends in a non-accepting state, reject.
5- ANFA ltB,wgt B is an NFA that accepts w
- Thm
- ANFA is a decidable language.
6- Proof
- N On input ltB,wgt where B is an NFA,
- and w is a string
- 1. Convert NFA B to an equivalent DFA C using
the - procedure in Thm. 1.19
- 2. Run TM M from the previous Thm on input ltC,wgt
- 3. If M accepts, accept otherwise reject.
7- AREXltR,wgt R is a regular expression that
generates string w - Thm
- AREX is a decidable language.
8- Proof
- P On input ltR,wgt where R is a regular
expression and w is a string. - 1. Convert R to an equivalent DFA A by the
- procedure given in Thm 1.28
- 2. Run TM M on input ltA,wgt
- 3. If Maccepts , accept if M rejects, reject.
9- EDFA ltAgt A is a DFA and L(A)Ø
- Thm
- EDFA is a decidable language
10- Proof
- T On input ltAgt where A is a DFA
- 1. Mark the start state of A.
- 2. Repeat until no new state get marked
- 3. Mark any state that has a transition
- coming into it from any state that is
- already marked.
- 4. If no accept state is marked, accept
- otherwise reject.
11- EQDFAltA,Bgt A and B are DFAs and
- L(A)L(B)
- Thm
- EQDFA is a decidable language.
12- Proof
-
-
- L(C) Ø iff L(A)L(B)
- L(C) is regular, since regular languages are
closed under complementation, union, and
intersection. -
- F On input ltA,Bgt, where A and B are DFAs
- 1. Construct DFA C as described
- 2. Run the TM in the previous Thm on input ltCgt.
- 3. If accepts, accept otherwise reject.
13Decidable problems concerning Context-free
languages
- ACFGltG,wgt G is a CFG that generates
- string w
- Thm
- ACFG is a decidable language
14- Proof
- S On input ltG,wgt, where G is a CFG
- and w is a string
- 1. Convert G to Chomsky normal form.
- 2. List all derivations with 2n-1 steps,
- where n is the length of w.
- 3. If any of these derivations generate w,
accept - otherwise reject.
15- ECFGltGgt G is a CFG and L(G)Ø
- Thm
- ECFG is a decidable language.
16- Proof
- R On input ltGgt, where G is a CFG
- 1. Mark all terminal symbols in G
- 2. Repeat until no new variables get marked
- 3. Mark all variables A with
- A?U1 Uk
- marked
- 4. If the start symbol is not marked, ACCEPT
- else reject.
17- EQCFGltG,Hgt G and H are CFLs and L(G)L(H)
- Not decidable
- Note that CFL is NOT closed under
complementation or intersection. So the same
technique for EQDFA DOES NOT work - Thm
- Every CFL is decidable.
18- Proof
- Let G be a CFG for A and design a TM MG that
decides A - MG On input w
- 1. Run TM S on input ltG,wgt
- 2. If this machine accepts, ACCEPTS
- otherwise REJECTS.
Defined before
19Halting Problem
- ATMltM,wgt M is a TM and M accepts w
- Thm
- ATM is un-decidable .
20- (conti.)
- UOn input ltM,wgt, where M is a TM
- and w is a string
- 1. Simulate M on input w.
- 2. If M ever enters its accept state, accept
- if M ever enters reject state, reject.
-
- U recognizes ATM but NOT decides it!
21- Diagonalization Method (Georg Cantor in 1873)
-
- A and B are the same size if there is a
- 1-1, onto function f A?B
f is 1-1 f(a) ? f(b) , if a? b
f
A
B
22- Eg
- N1,2,3, E2,4,6,
- f(n)2n
-
n 1 2 3 4 5
f(n) 2 4 6 8 10
23- Def
- A is countable if either it is finite
- or it has the same size as N .
24 25 26- Proof
- By contradiction.
- Suppose there is a 1-1 onto f between N and R.
-
- Thus x?f(n) for any n ?
n f(n)
1 2 3 4 ? 3.14159? 55.5555? 0.1234? 0.5000? ?
x0.4201? The i-th digit of x is not equal to
the i-th of f(i)
27- ATMltM,wgt M is a TM and M accepts w
- Thm
- ATM is un-decidable.
28- Proof
- Assume ATM is decidable.
- Suppose H decides ATM and
- H(ltM,wgt) accept if M accepts w
- reject if M does not accept w
- Define
- D On input ltMgt, where M is a TM
- 1. Run H on input lt M,ltMgt gt.
- 2. Output the opposite of what H outputs
- i.e. if H accepts, REJECT,
- and if H rejects, ACCEPT.
29- (Proof conti.)
- D(ltMgt) accept if M does not accept ltMgt
- reject if M accepts ltMgt
- D(ltDgt) accept if D does not accept ltDgt
- reject if D accepts ltDgt
- ?
- Thus, ATM is un-decidable.
30- 1.
-
- (i, j) is accept if Mi accepts ltMjgt
ltM1gt ltM2gt ltM3gt ltM4gt ?
M1 Accept Accept
M2 Accept Accept Accept Accept
M3
M4 Accept Accept
?
31- 2.
-
- (i, j) is the value of H on input ltMi ,ltMjgtgt.
ltM1gt ltM2gt ltM3gt ltM4gt ?
M1 Accept Reject Accept Reject
M2 Accept Accept Accept Accept
M3 Reject Reject Reject Reject
M4 Accept Accept Reject Reject
?
32ltM1gt ltM2gt ltM3gt ltM4gt ? ltDgt ?
M1 Accept Reject Accept Reject Accept
M2 Accept Accept Accept Accept Accept
M3 Reject Reject Reject Reject ? Reject ?
M4 Accept Accept Reject Reject Accept
? ? ?
D Reject Reject Accept Accept ??
? ? ?
Contradiction!
33- Turing-unrecognizable language
- A language is co-Turing-recognizable if it is
the Complement of a Turing-recognizable language. - Thm
- A language is decidable iff it is both
Turing-recognizable and co-Turing-recognizable.
34- Proof
- ?
- If A is decidable, then both A and are
- Turing-recognizable.
-
Yes
Yes
Yes
MA
x
MA
x
No
No
No
35- (Proof conti.)
- ?
- If both A and are Turing-recognizable,
- let M1 recognize A and M2 recognize .
-
-
- M decides A.
M
M1
Yes
Yes
x
M2
No
Yes
36- Cor
- is not Turing-recognizable.