Upcoming SlideShare
×

# MELJUN CORTES Automata Theory (Automata18)

307 views

Published on

MELJUN CORTES Automata Theory (Automata18)

Published in: Technology
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
307
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
9
0
Likes
0
Embeds 0
No embeds

No notes for slide

### MELJUN CORTES Automata Theory (Automata18)

1. 1. MELJUN P. CORTES, MBA,MPA,BSCS,ACS Fall 2008 CSC 3130: Automata theory and formal languages More undecidable languages MELJUN CORTES
2. 2. More undecidable problems L1 = { 〈 M 〉 : M is a TM that accepts input ε} L2 = { 〈 M 〉 : M is a TM that accepts some input} L3 = { 〈 M 〉 : M is a TM that accepts all inputs} L4 = { 〈 M, M’ 〉 : M and M’ accept the same inputs} decidable recognizable but undecidable unrecognizable
3. 3. Example 1 L1 = { 〈 M 〉 : M is a TM that accepts input ε} • Step 1: You gotta believe it – To know if M accepts ε, it looks like we have to simulate it – But then we might end up in a loop • Step 2: Use what you know ATM is undecidable
4. 4. Proof by “reduction” L1 = { 〈 M 〉 : M is a TM that accepts input ε} • Show that if L1 can be decided, 〈M 〉 A accept if M accepts ε reject if not ... so can ATM 〈M〉, w ? accept if M accepts w reject if not
5. 5. Proof by “reduction” 〈M 〉 〈M〉, w accept if M accepts ε A reject if not 〈 M’ 〉 A accept if M accepts w reject if not M’ is a Turing Machine such that: If M accepts w, then M’ accepts ε If M does not accept w, then M’ does not accept ε
6. 6. Proof by “reduction” construct M’ 〈 M’ 〉 A M’: On input z, If z = ε, then simulate M on w Otherwise, reject reject if not R /☐ ☐ q0 q1 M’ ☐/☐L 〈M〉, w accept if M accepts w M qrej qacc
7. 7. Recognizable or not? L1 = { 〈 M 〉 : M is a TM that accepts input ε} decidable recognizable but undecidable Algorithm for L1 On input 〈 M 〉 : Simulate M on input ε unrecognizable
8. 8. Example 2 L2 = { 〈 M 〉 : M is a TM that accepts some input} • Step 1: You gotta believe it – To know if M accepts, it looks like we have to simulate it – But then we might end up in a loop • Step 2: Use what you know ATM is undecidable L1 is undecidable
9. 9. Example 2 〈M 〉 〈M〉 accept if M accepts some input A reject if not 〈 M’ 〉 A accept if M accepts ε reject if not M’ is a Turing Machine such that: If M accepts ε, then M’ accepts some input If M does not accept ε, then M’ does not accept anything
10. 10. Example 2 〈M〉 construct M’ 〈 M’ 〉 accept if M accepts w A reject if not M’: On input w, If w = ε, then simulate M on ε Otherwise, reject decidable recognizable but undecidable unrecognizable
11. 11. Is it recognizable? L2 = { 〈 M 〉 : M is a TM that accepts some input} • Attempt to recognize L2: Simulate M on input ε Simulate M on input 0 Simulate M on input 1 Simulate M on input 00 Accept if one of them accepts ... ... but there are infinitely many!
12. 12. Is it recognizable? L2 = { 〈 M 〉 : M is a TM that accepts some input} • Attempt to recognize L2: For all possible strings x (in lexicographic order): Simulate M on input x what if M loops on ε If it accepts, accept. but M accepts, say, 11? If it rejects, reject. lexicographic order: ε, 0, 1, 00, 01, 10, 11, 000, 001, ...
13. 13. Is it recognizable? L2 = { 〈 M 〉 : M is a TM that accepts some input} • Description of Turing Machine that recognizes L2: k := 1 For all possible strings x (in lexicographic order): For all strings y that come before x Simulate M on y for k steps If it accepts, accept. If it rejects, reject. k := k + 1
14. 14. Explanation of algorithm inputs ε 0 1 00 01 ... • Execution of algorithm Simulate M on ε for 1 step Simulate M on ε for 2 steps Simulate M on 0 for 2 steps Simulate M on ε for 3 steps Simulate M on 0 for 3 steps Simulate M on 1 for 3 steps If M accepts some w, algorithm will see this in some stage of the simulation ... decidable recognizable but undecidable unrecognizable
15. 15. Example 3 L3 = { 〈 M 〉 : M is a TM that accepts all inputs} • Step 1: You gotta believe it – To know if M accepts, it looks like we have to simulate it – But then we might end up in a loop • Step 2: Use what you know ... by yourself this time! decidable recognizable but undecidable unrecognizable
16. 16. Is it recognizable? L3 = { 〈 M 〉 : M is a TM that accepts all inputs} • Let’s try... Simulate M on ε for 1 step Simulate M on ε for 2 steps Simulate M on 0 for 2 steps Simulate M on ε for 3 steps Simulate M on 0 for 3 steps Simulate M on 1 for 3 steps and then what? accept if all of them accept but there are infinitely many! ...
17. 17. Is it recognizable? L3 = { 〈 M 〉 : M is a TM that accepts all inputs} – To check that 〈 M 〉 is in L3, it looks like we have to wait for an infinite number of simulations to finish – But we don’t have that much time! • Step 1: You gotta believe it ... but I don’t! decidable recognizable but undecidable unrecognizable
18. 18. How to argue unrecognizability L3 = { 〈 M 〉 : M is a TM that accepts all inputs} • First attempt: Remember that If L and L are both recognizable, then L is decidable. ... so we can try to argue that L3 is recognizable
19. 19. First attempt L3 = { 〈 M 〉 : M is a TM that accepts all inputs} L3 = { 〈 M 〉 : M is a TM that does not accept all inputs} • Let’s try... Simulate M on ε for 1 step Simulate M on ε for 2 steps Simulate M on 0 for 2 steps Simulate M on ε for 3 steps Simulate M on 0 for 3 steps Simulate M on 1 for 3 steps accept if M rejects or loops but how to know if it loops? ...
20. 20. How to argue unrecognizability L3 = { 〈 M 〉 : M is a TM that accepts all inputs} • Second attempt: Use what you know ATM is not recognizable • We can try to argue that If we can recognize L3 then we can also recognize ATM
21. 21. Proof by “reduction” 〈M 〉 〈M〉, w A construct 〈 M’ 〉 M’ accept if M accepts all inputs rej/loop if not A accept if M does not accept w rej/loop if M accepts w M’ is a Turing Machine such that: If M does not accept w, then M’ accepts all inputs If M accepts w, then M’ rejects or loops on some input
22. 22. Constructing M’ M’ is a Turing Machine such that: If M does not accept w, then M’ accepts all inputs If M accepts w, then M’ rejects or loops on some input • To do this, we want to simulate M on w ... but what if simulation loops? • Idea: M’ keeps accepting more and more of its inputs as long as M has not halted on w – If M never halts on w, M’ will accept all inputs
23. 23. Constructing M’ M’ is a Turing Machine such that: If M does not accept w, then M’ accepts all inputs If M accepts w, then M’ rejects or loops on some input • Description of M’: length of z On input z, Simulate M on input w for |z| steps If simulation of M reaches state qacc, reject. If simulation of M reaches state qrej, accept. If neither state is reached, accept.
24. 24. Correctness of construction M’ is a Turing Machine such that: If M does not accept w, then M’ accepts all inputs If M accepts w, then M’ rejects or loops on some input Description of M’: On input z, Simulate M on input w for |z| steps If simulation of M reaches state qacc, reject. If simulation of M reaches state qrej, accept. If neither state is reached, accept.
25. 25. Correctness of construction M’ is a Turing Machine such that: If M does not accept w, then M’ accepts all inputs If M accepts w, then M’ rejects or loops on some input Description of M’: In k steps z = 0k On input z, Simulate M on input w for |z| steps If simulation of M reaches state qacc, reject. If simulation of M reaches state qrej, accept. If neither state is reached, accept. M’ rejects input 0k
26. 26. Example 3 recap L3 = { 〈 M 〉 : M is a TM that accepts all inputs} • We showed that If we can recognize L3 then we can also recognize ATM ... but we know ATM is not recognizable so decidable recognizable but undecidable unrecognizable
27. 27. Example 4 L4 = {( 〈 M1 〉 , 〈 M2 〉 ): M1 and M2 accept the same inputs • Step 1: You gotta believe it decidable recognizable but undecidable unrecognizable • Step 2: Use what you know ATM is recognizable but undecidable L1 is recognizable but undecidable ATM is unrecognizable L2 is recognizable but undecidable L3 is unrecognizable
28. 28. Example 4 L4 = {( 〈 M1 〉 , 〈 M2 〉 ): M1 and M2 accept the same inputs} 〈 M1 〉 , 〈 M2 〉 A accept if M1, M2 accept same inputs rej/loop if not L3 = { 〈 M 〉 : M is a TM that accepts all inputs} 〈M〉 ? accept if M accepts all inputs rej/loop if not
29. 29. Example 4 〈 M1 〉 , 〈 M2 〉 accept if M1, M2 accept same inputs A 〈M 〉 qacc rej/loop if not 〈 M1 〉 〈 M2 〉 A accept if M accepts all inputs rej/loop if not If M accepts all inputs, then M1, M2 accepts same inputs If M does not, then M1, M2 do not accept same inputs M1 = M M2 = TM that always accepts