Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tutorial 11 -- CSC3130 : Formal Languages and Automata Theory Tu Shikui ( ) SHB 905, Office hour: Thursday 2:30pm-3:30pm 2008-11-16.

Similar presentations


Presentation on theme: "Tutorial 11 -- CSC3130 : Formal Languages and Automata Theory Tu Shikui ( ) SHB 905, Office hour: Thursday 2:30pm-3:30pm 2008-11-16."— Presentation transcript:

1 Tutorial 11 -- CSC3130 : Formal Languages and Automata Theory Tu Shikui ( sktu@cse.cuhk.edu.hk ) SHB 905, Office hour: Thursday 2:30pm-3:30pm 2008-11-16

2 Outline Examples for Decidable Undecidable but Recognizable Unrecognizable

3 The difference -- between Recognizable and decidable If L is decidable, then L is recognized by a TM M that halts on all inputs. Note that, L might be recognized by other TM M’ that does not always halt. If L is recognizable, then there might be such TM M that recognizes L but run forever, rather than rejecting, some inputs not in L. Simply, Decidable ---- always halt Recognizable ---- halt or loop

4 Example 1 -- Is it decidable? Proof: Decidable. Construct a TM M as follows: L(A)L(B) The shaded area:

5 Example 2 -- Is it decidable? A decider of target problem Construct M w The answer: NOT decidable. The difficulty: How to prove a language to be not decidable? accept reject The target problem is embedded. w

6 Example 2 -- Is it decidable?  NO. Construct M w Proof: (reduce it to Halting problem.) Suppose we have a TM D such that D 〈M〉〈M〉 Accept, if L(M) finite Reject, if L(M) NOT finite D 〈Mw〉〈Mw〉 〈M〉〈M〉 w Then, we should consider: HALT TM = {( 〈 M 〉, w): M is a TM that halts on input w} Accept, if M halts Reject, if M does not halt

7 How to construct M w ? halts on is infinite if and only if Our Target … Construction On any input string: s Simulate M on w ; If M halts, accept s, else reject s, end

8 Example 2 -- Is it decidable?  NO. Construct M w D 〈M〉〈M〉 Accept, if L(M) finite Reject, if L(M) NOT finite D 〈Mw〉〈Mw〉 〈M〉〈M〉 w HALT TM = {( 〈 M 〉, w): M is a TM that halts on input w} Accept, if M halts Reject, if M does not halt reject accept halts on is infinite if and only if

9 Example 3 -- Is it decidable? Construct M w Proof: (reduce it to Halting problem.) Suppose we have a TM D such that D 〈M〉〈M〉 Accept, if … Reject, if NOT … D 〈Mw〉〈Mw〉 〈M〉〈M〉 w Then, we should consider: HALT TM = {( 〈 M 〉, w): M is a TM that halts on input w} Accept, if M halts Reject, if M does not halt

10 How to construct M w ? halts on Contains two equal length strings if and only if Our Target … Construction On any input string: s Simulate M on w ; If M halts, accept if s=a or s=b else reject s, end

11 Example 4 -- Is it decidable? Construct M w Proof:Suppose we have a TM D such that D 〈M〉〈M〉 Accept, if … D 〈Mw〉〈Mw〉 〈M〉〈M〉 w Accept, if M accept w A TM = {( 〈 M 〉, w): M is a TM that accepts w} Reject, if NOT … Reject, if not

12 End of this tutorial! Thanks for coming!


Download ppt "Tutorial 11 -- CSC3130 : Formal Languages and Automata Theory Tu Shikui ( ) SHB 905, Office hour: Thursday 2:30pm-3:30pm 2008-11-16."

Similar presentations


Ads by Google