Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intro to Theory of Computation

Similar presentations


Presentation on theme: "Intro to Theory of Computation"β€” Presentation transcript:

1 Intro to Theory of Computation
LECTURE 17 Last time Reductions Mapping reductions Today Computation history method CS 332 Sofya Raskhodnikova 3/17/2016

2 Exercise A language L is Turing-recognizable ⇔ L ≀ π’Ž 𝑨 𝑻𝑴
Only the β‡’ direction is true. Only the ⇐ direction is true. Both directions are true. Neither direction is true. {madam, dad, but, tub, book} 3/17/2016

3 Problems in language theory
ADFA decidable ACFG decidable EDFA decidable ECFG decidable EQDFA decidable ATM undecidable ETM undecidable EQCFG ? EQTM undecidable 3/17/2016

4 Computation history method
Proving undecidability for languages that do not involve TM descriptions Computation history method 3/17/2016

5 A linear bounded automaton (LBA)
A linear bounded automaton (LBA) is a TM variant that has bounded tape, with the number of tape squares equal to the size of the input. FINITE STATE CONTROL Linear memory (by increasing the alphabet – can use ``tracks’’ on the tape). Every CFL can be decided by an LBA. 1 1 1 3/17/2016

6 Configurations A configuration of an LBA is a setting of state, head position and tape contents. 110βŒ©π‘ž7βŒͺ Snapshot in the middle of computation q7 1 3/17/2016

7 Exercise How many distinct configurations does an LBA have if it has 𝒒 states, π’ˆ symbols in tape alphabet, and the tape of length 𝒏? π’’π’ˆπ’ 𝒒+π’ˆ+𝒏 𝒒 π’ˆ 𝒏 𝒒𝒏 π’ˆ 𝒏 None of the above. {madam, dad, but, tub, book} 3/17/2016

8 Prove that ALBA is decidable
ALBA= { 𝑩, π’˜ ∣ 𝑩 is an LBA that accepts string π’˜ } Idea: Given 𝑩, π’˜ , simulate B on w. If it halts, we know the answer. If it loops, we can detect because B repeats a configuration. S = `` On input βŒ©π‘©,π’˜βŒͺ, where 𝑩 is an LBA and w is a string: Simulate B on w for 𝒒𝒏 π’ˆ 𝒏 steps. If it accepts, accept. If it rejects or does not halt, reject.’’ 3/17/2016

9 starting configuration accepting configuration
Computation history An accepting computation history for a TM M on input w is a sequence of configurations entered by M on input w: A log π‘ͺ 𝟎 # π‘ͺ 𝟏 #…# π‘ͺ β„“ starting configuration accepting configuration 3/17/2016

10 Starting configuration
q0 1 π‘ͺ 𝟎 =〈 π‘ž 𝟎 βŒͺ𝐰 〈 π‘ž 𝟎 βŒͺ𝐰 3/17/2016

11 Accepting configuration
qacc 1 π‘ͺ β„“ =〈 π‘ž 𝟎 βŒͺ𝐰 … π‘ž 𝒂𝒄𝒄 … 3/17/2016

12 Each π‘ͺ π’Š+𝟏 legally follows from π‘ͺ π’Š
q7 q5 1 2 1 1 π‘ͺ π’Š = βŒ©π‘ž7βŒͺ π‘ͺ π’Š+𝟏 = 〈 π‘ž 𝟎 βŒͺ𝐰 𝟐 βŒ©π‘žπŸ“βŒͺ 1 1 0 3/17/2016

13 Given a TM M and a string w,
LBAs can check computation histories of TMs Given a TM M and a string w, we can construct an LBA that checks whether its input is the accepting computation history of M on w. 3/17/2016

14 Prove that ELBA is undecidable
ELBA = { 𝑩 ∣ 𝑩 is a LBA and 𝑳 𝑩 =βˆ… } Proof: Suppose to the contrary that TM R decides ELBA . We construct TM S that decides ATM. S = `` On input βŒ©π‘΄,π’˜βŒͺ, where 𝑴 is a TM and w is a string: Construct an LBA 𝑩 from 𝑴 and π’˜: Run TM R on input <𝑩>. If , accept. O.w. reject.’’ 𝑩 = `` On input x, Accept if x = π‘ͺ 𝟎 #…# π‘ͺ β„“ is the accepting configfaddur computation history of M on w: π‘ͺ 𝟎 is the starting configuration of 𝑴 on 𝑀 Each π‘ͺ π’Š+𝟏 legally follows from π‘ͺ π’Š π‘ͺ β„“ is an accepting configuration for 𝑴 ’’ it rejects 3/17/2016

15 ALLPDA = { 𝑷 ∣ 𝑷 is a PDA that accepts all strings }
ALLPDA is undecidable ALLPDA = { 𝑷 ∣ 𝑷 is a PDA that accepts all strings } We can use the computation history method to show that ALLPDA is undecidable. It follows that ALLCFG is undecidable. It follows that EQCFG is undecidable. 3/17/2016

16 Problems in language theory
ADFA decidable ACFG decidable EDFA decidable ECFG decidable EQDFA decidable ATM undecidable ETM undecidable EQCFG undecidable EQTM undecidable 3/17/2016

17 Post Correspondence Problem
Domino: 𝒂 𝒂𝒃 . Top and bottom are strings. Input: collection of dominos. 𝒂𝒂 𝒂𝒃𝒂 , 𝒂𝒃 𝒂𝒃𝒂 , 𝒃𝒂 𝒂𝒂 , 𝒂𝒃𝒂𝒃 𝒃 Match: list of some of the input dominos (repetitions allowed) with top = bottom 𝒂𝒃 𝒂𝒃𝒂 , 𝒂𝒂 𝒂𝒃𝒂 , 𝒃𝒂 𝒂𝒂 , 𝒂𝒂 𝒂𝒃𝒂 , 𝒂𝒃𝒂𝒃 𝒃 Problem: determine if a match exists. POST={input with a match} is undecidable. We can use the computation history method to show that ALLPDA is undecidable. 3/17/2016

18 Exercise (π’Žβˆ’πŸ)(π’βˆ’πŸ)|𝑸| π’Žπ’ 𝑸 π’Žπ’ 𝑸 β‹…|𝚺| π’Žπ’ 𝑸 β‹… 𝚺 (π’Žβˆ’πŸ)(π’βˆ’πŸ)
A two-dimensional automaton (2DIM-DFA) takes an π’ŽΓ—π’ rectangle as input, for any π’Ž,𝒏β‰₯𝟐. The boundary squares contain #; internal squares contain symbols from alphabet 𝚺. The transition function 𝜹:𝑸× 𝚺βˆͺ # →𝑸× 𝑳,𝑹,𝑼,𝑫 indicates the next state and head movement (left, right, up, down). How many distinct configurations does a 2DIM-DFA have on a given input? (π’Žβˆ’πŸ)(π’βˆ’πŸ)|𝑸| π’Žπ’ 𝑸 π’Žπ’ 𝑸 β‹…|𝚺| π’Žπ’ 𝑸 β‹… 𝚺 (π’Žβˆ’πŸ)(π’βˆ’πŸ) None of the above. {madam, dad, but, tub, book} # # 𝟎 𝟏 # 𝟎 𝟏 # 𝟎 𝟏 # 𝟎 𝟏 # 3/17/2016

19 Exercise YES to both. NO to both. YES to 1, NO to 2.
Let 𝐀 2DIMβˆ’DFA = { 𝑫,𝒙 ∣ D is a 2DIM-DFA and 𝑫 accepts 𝒙} Can a 2DIM-DFA loop? Is 𝐀 2DIMβˆ’DFA decidable? YES to both. NO to both. YES to 1, NO to 2. NO to 1, YES to 2. {madam, dad, but, tub, book} 3/17/2016


Download ppt "Intro to Theory of Computation"

Similar presentations


Ads by Google