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 19 Last time Reductions Mapping reductions Today Computation history method CS 464 Sofya Raskhodnikova 3/17/2016

2 Mapping Reductions Proving undecidability and unrecognizability
3/17/2016

3 if there is a computable function 𝒇, such that for all strings 𝒘,
Mapping reductions Given languages A and B, A ≤ 𝒎 B if there is a computable function 𝒇, such that for all strings 𝒘, 𝒘∈ 𝑨 iff 𝒇(𝒘)∈𝑩. A B 𝒇 3/17/2016

4 Using mapping reductions to prove decidability
Theorem. If A ≤ 𝒎 B and B is decidable, then A is decidable. Proof: 𝐋𝐞𝐭 𝑴 be a decider for 𝑩 and 𝒇 be a mapping reduction from A to B. Construct a decider for A: ``On input w: Compute f(w). Run M on f(w). If it accepts, accept. O.w. reject.” 3/17/2016

5 Using mapping reductions to prove undecidability
Theorem. If A ≤ 𝒎 B and B is decidable, then A is decidable. Corollary. If A ≤ 𝒎 B and A is undecidable, then B is undecidable. Example: If ATM≤ 𝒎 B, then B is undecidable. 3/17/2016

6 Using mapping reductions to prove recognizability
Theorem. If A ≤ 𝒎 B and B is Turing-recognizable, then A is Turing-recognizable. Proof: 𝐋𝐞𝐭 𝑴 be a TM that recognizes 𝑩 and 𝒇 be a mapping reduction from A to B. Construct a TM that recognizes A: ``On input w: Compute f(w). Run M on f(w). If it accepts, accept. O.w. reject.” 3/17/2016

7 Using mapping reductions to prove unrecognizability
Theorem. If A ≤ 𝒎 B and B is Turing-recognizable, then A is Turing-recognizable. Corollary. If A ≤ 𝒎 B and A is unrecognizable, then B is unrecognizable. Example: If ATM≤ 𝒎 B, then B is unrecognizable. 3/17/2016

8 I-clicker question (frequency: AC)
If 𝐀 ≤ 𝒎 𝑩 , we can conclude that 𝑨 ≤ 𝒎 𝑩 𝑩 ≤ 𝒎 A 𝐀 ≤ 𝒎 𝑩 𝐁 ≤ 𝒎 𝑨 None of the above. {madam, dad, but, tub, book} 3/17/2016

9 Old proof that EQTM is undecidable
EQTM = { 𝑴 𝟏 , 𝑴 𝟐 ∣ 𝑴 𝟏 , 𝑴 𝟐 are TMs, 𝑳 𝑴 𝟏 =𝑳( 𝑴 𝟐 )} Proof: Suppose to the contrary that EQTM is decidable, and let R be a TM that decides it. We construct TM S that decides ATM. S = `` On input 〈𝑴,𝒘〉, where 𝑴 is a TM and w is a string: Construct TMs 𝑴 ′ ,𝑴′′. Run TM R on input < 𝑴 ′ ,𝑴′′>. If , accept. O.w. reject.’’ 𝑀′ = `` On input x, Ignore the input. Run TM M on input w. If it accepts, accept.’’ 𝑀′′ = ``Accept.’’ it accepts 3/17/2016

10 ATM ≤ 𝒎 EQTM Proof: The following TM computes the reduction:
F = `` On input 〈𝑴,𝒘〉, where 𝑴 is a TM and w is a string: Construct TMs 𝑴 ′ ,𝑴′′. Output < 𝑴 ′ ,𝑴′′>.” 𝑀′ = `` On input x, Ignore the input. Run TM M on input w. If it accepts, accept.’’ 𝑀′′ = ``Accept.’’ ATM EQTM 𝒇 3/17/2016

11 Conclusions from ATM ≤ 𝒎 EQTM
Since ATM is undecidable, so is EQTM ATM ≤ 𝒎 EQTM Since ATM is unrecognizable, so is EQTM 3/17/2016

12 Prove that EQTM is unrecognizable
Proof: We give a mapping reduction ATM ≤ 𝒎 EQTM The following TM computes the reduction: F = `` On input 〈𝑴,𝒘〉, where 𝑴 is a TM and w is a string: Construct TMs 𝑴 ′ ,𝑴′′. Output < 𝑴 ′ ,𝑴′′>.” 𝑀′ = `` On input x, Ignore the input. Run TM M on input w. If it accepts, accept.’’ 𝑀′′ = ``Reject.’’ ATM EQTM 𝒇 3/17/2016

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

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

15 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

16 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

17 I-clicker question (frequency: AC)
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

18 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

19 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

20 Starting configuration
q0 1 𝑪 𝟎 =〈 𝑞 𝟎 〉𝐰 〈 𝑞 𝟎 〉𝐰 3/17/2016

21 Accepting configuration
qacc 1 𝑪 ℓ =〈 𝑞 𝟎 〉𝐰 … 𝑞 𝒂𝒄𝒄 … 3/17/2016

22 Each 𝑪 𝒊+𝟏 legally follows from 𝑪 𝒊
q7 q5 1 2 1 1 𝑪 𝒊 = 〈𝑞7〉 𝑪 𝒊+𝟏 = 〈 𝑞 𝟎 〉𝐰 𝟐 〈𝑞𝟓〉 1 1 0 3/17/2016

23 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

24 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


Download ppt "Intro to Theory of Computation"

Similar presentations


Ads by Google