381hw12solns - CS381, Homework #12 Solutions Question 1...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS381, Homework #12 Solutions Question 1 Prove that the intersection of two CFGs is undecidable. We shall prove this fact with a reduction from the halting problem to the intersection of two CFGs. Recall from class, that for some Turing Machine M , on some input x we can write the valid computations of M as G = L ( C 1 ) L ( C 2 ) = k 1 ( k 2 ) R ... k n . If you do not remember how to do this, review your course notes. Now observe, that if G (which is the intersection of two context free lan- guages) is non-empty, then it must contain some finite length string, which means that the Turing Machine M has some sequence of valid computations such that it halts on input x. We can make sure that when we formulate our intersection, we allow the machine to end in any state (and not just final states) as long as no input remains and there are no epsilon transitions from the state in k n . Thus, it may be that a string x is not accepted by M , but if G is nonempty, it can be assured that M halts on x . If the intersection is empty on the other hand, then there is no such sequence, and the Turing Machine will run forever. This gives us a way to determine if a machine if a Turing Machine M halts on input x using the intersection of two CFLs. This conclusion though creates a contradiction, for if this intersection problem were decidable, we could solve the halting problem using it, and since we know that the halting problem is in fact undecidable, it cannot be that the intersection of two context free languages is decidable....
View Full Document

This homework help was uploaded on 09/28/2007 for the course COM S 381 taught by Professor Hopcroft during the Fall '05 term at Cornell University (Engineering School).

Page1 / 5

381hw12solns - CS381, Homework #12 Solutions Question 1...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online