Download presentation
Presentation is loading. Please wait.
1
More undecidable languages
The Chinese University of Hong Kong Fall 2009 CSC 3130: Automata theory and formal languages More undecidable languages Andrej Bogdanov
2
Summary of last lecture
input x M on input x program 〈M〉 The universal TM U takes as inputs a program M and a string x and simulates M on x The program M itself is specified as a TM!
3
Summary of last lecture
recognizable: undecidable: We can simulate M on input w by Turing’s Theorem ATM = {〈M, w〉: M is a TM that accepts input w} by complementation not recognizable: ATM = {〈M, w〉: M is a TM that does not accept w} recognizable: undecidable We can simulate M on input x by reduction from ATM HALTTM = {〈M, w〉: M is a TM that halts on input w}
4
More undecidable problems
AEPSTM = {〈M〉: M is a TM that accepts input e} SOMETM = {〈M〉: M is a TM that accepts some input} EQTM = {〈M, M’〉: M and M’ accept the same inputs} decidable recognizable but undecidable unrecognizable
5
Example 1 AEPSTM = {〈M〉: M is a TM that accepts input e}
Step 1: You gotta believe it To know if M accepts e, 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
6
Proof by “reduction” ? AEPSTM = {〈M〉: M is a TM that accepts input e}
Show that if AEPSTM can be decided, so can ATM 〈M〉 A accept if M accepts e reject if not ? accept if M accepts w 〈M, w〉 reject if not
7
M’ on input e = M on input w
Proof by “reduction” 〈M〉 A accept if M accepts e reject if not accept if M accepts w A 〈M’〉 〈M, w〉 reject if not M’ is a Turing Machine such that: M’ on input e = M on input w If M accepts w, then M’ accepts e If M does not accept w, then M’ does not accept e
8
Proof by “reduction” A M’ M’: On input z,
accept if M accepts w construct M’ A 〈M’〉 〈M, w〉 reject if not M’ q1 M’: On input z, ☐/☐R ☐/☐L If z = e, then simulate M on w and return its answer Otherwise, reject write w q0 others run M qrej qacc
9
The argument We assume AEPSTM is decidable. Let A be a decider.
We describe (in high level) a TM that decides ATM: S: On input 〈M, w〉: Construct the following TM M’: Run A on input 〈M’〉 and return its answer. M’: On input z, If z = e, then simulate M on w and return answer Otherwise, reject S accepts 〈M, w〉 R accepts 〈M’〉 M’ accepts e M accepts w
10
Recognizable or not? AEPSTM = {〈M〉: M is a TM that accepts input e}
decidable recognizable but undecidable unrecognizable Turing Machine that recognizes AEPSTM: On input 〈M〉: Simulate M on input e and return answer.
11
Example 2 SOMETM = {〈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 AEPSTM is undecidable
12
Example 2 A A M’ is a Turing Machine such that:
accept if M accepts some input reject if not accept if M accepts e A 〈M’〉 〈M, w〉 reject if not M’ is a Turing Machine such that: If M accepts w, then M’ accepts some input If M does not accept w, then M’ does not accept anything
13
Example 2 A M’: On any input, Simulate M on w Return its answer
accept if M accepts w construct M’ A 〈M’〉 〈M, w〉 reject if not M’: On any input, Simulate M on w Return its answer M accepts w M’ accepts some input decidable recognizable but undecidable unrecognizable
14
Is it recognizable? SOMETM = {〈M〉: M is a TM that accepts some input} Attempt to recognize SOMETM: Simulate M on input e Simulate M on input 0 Simulate M on input 1 Accept if one of them accepts Simulate M on input 00 ... ... but there are infinitely many!
15
Is it recognizable? SOMETM = {〈M〉: M is a TM that accepts some input}
Attempt to recognize SOMETM: For all possible strings x (in lexicographic order): Simulate M on input x what if M loops on e but M accepts, say, 11? If it accepts, accept. If it rejects, reject. lexicographic order: e, 0, 1, 00, 01, 10, 11, 000, 001, ...
16
Is it recognizable? SOMETM = {〈M〉: M is a TM that accepts some input}
Description of recognizer for SOMETM: 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 or doesn’t finish, continue. k := k + 1
17
Execution of Turing Machine
... inputs e 1 00 01 Execution: Simulate M on e for 1 step If M accepts some w, execution will see this in some stage of the simulation Simulate M on e for 2 steps Simulate M on 0 for 2 steps Simulate M on e for 3 steps Simulate M on 0 for 3 steps Simulate M on 1 for 3 steps ... decidable recognizable but undecidable unrecognizable
18
Example 3 EQTM = {〈M1, M2〉: M1 and M2 accept the same inputs}
Step 1: You gotta believe it Step 2: Use what you know decidable recognizable but undecidable unrecognizable ATM is recognizable but undecidable AEPSTM is recognizable but undecidable SOMETM is recognizable but undecidable ATM is unrecognizable
19
Example 3 ? A EQTM = {〈M1, M2〉: M1 and M2 accept the same inputs}
accept if M1, M2 accept same inputs rej/loop if not ATM = {〈M, w〉: M is a TM that does not accept w} ? accept if M rej/loops on w 〈M, w〉 rej/loop if M accepts w
20
Example 3 A A M1, M2 accept same inputs M rej/loops on w 〈M1, M2〉
accept if M1, M2 accept same inputs rej/loop if not accept if M rej/loops on w 〈M, w〉 A 〈M1〉 〈M2〉 M1: “On any input: Run M on w” M2: “Reject” rej/loop if M accepts w M1, M2 accept same inputs M rej/loops on w
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.