400 likes | 426 Views
Decidability. continued. Undecidable Problems. Halting Problem:. Does machine halt on input ?. State-entry Problem:. Does machine enter state halt on input ?. Blank-tape halting problem:. Does machine halt when starting on blank tape?.
E N D
Decidability continued
Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input ?
Blank-tape halting problem: Does machine halt when starting on blank tape? Membership problem: Is a string member of a recursively enumerable language ?
Uncomputable Functions Values region Domain A function is uncomputable if it cannot be computed for all the domain
Function : maximum number of moves until any Turing machine with states halts when started with the blank tape
Theorem: Function is uncomputable Proof: If was computable then the blank-tape halting problem would be decidable
Algorithm for blank-tape halting problem Input: machine 1. Count states of : 2. Compute 3. Simulate for steps starting with empty tape If halts then return YES otherwise return NO
Non-trivial property of recursively enumerable languages: any property possessed by some (not all) recursively enumerable languages
Some non-trivial properties of recursively enumerable languages: • is empty • is finite • contains two different strings • of the same length
Rice’s Theorem: Any non-trivial property of a recursively enumerable language is undecidable
Theorem: For a recursively enumerable language it is undecidable to determine whether is empty Proof: We will reduce the membership problem to this problem
Membership problem: Inputs: machine and string Question: ?
Construct machine : When enters a final state, compare input with Observations: if and only if is empty
Algorithm for membership problem: Inputs: machine and string 1. Construct 2. Determine if is empty Yes: then No: then
Membership machine yes no Check if construct no is empty yes
Theorem: For a recursively enumerable language it is undecidable to determine whether is finite Proof: We will reduce the halting problem to this problem
Halting problem: Inputs: machine and string Question: does halt on input ?
Construct machine : When enters a halt state, accept any input Initially, simulates on input (virtual input)
Observations: If is finite then halts on if and only if is infinite
Algorithm for halting problem: Inputs: machine and string 1. Construct 2. Determine if is finite Yes: then doesn’t halt on No: then halts on
Machine for halting problem yes no Check if construct no is finite yes
Theorem: For a recursively enumerable language it is undecidable to determine whether contains two different string of same length Proof: We will reduce the halting problem to this problem
Halting problem: Inputs: machine and string Question: does halt on input ?
Construct machine : When enters a halt state, accept symbols or Initially, simulates on input (virtual input)
Observation: halts on if and only if accepts and (strings of equal length)
Algorithm for halting problem: Inputs: machine and string 1. Construct 2. Determine if accepts strings of equal length Yes: then halts on No: then doesn’t halt on
Machine for halting problem yes yes Check if construct no Has equal length strings no
Some undecidable problems for context-free languages: • Is context-free grammar ambiguous? • Is ?
We need a tool to prove that the previous problems for context-free languages are undecidable: The Post Correspondence Problem
The Post Correspondence Problem Input: Two sequences of strings
There is a Post Correspondence Solution if there is a sequence such that: PC-solution
Example: PC-solution:
Example: There is no solution Because total length of strings from is smaller than total length of strings from
The Modified Post Correspondence Problem Inputs: MPC-solution:
Example: MPC-solution:
We will show that: The Modified Post Correspondence Problem is undecidable In other words: There is not MPC-solution for any pair
Proof Technique: We will reduce the membership problem to the MPC problem
Membership problem: Does Turing machine accept string Equivalent Problem: Does unrestricted Grammar generate string ?