sol04

# sol04 - CS 154 Intro. to Automata and Complexity Theory...

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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 154 Intro. to Automata and Complexity Theory Handout 27 Autumn 2009 David Dill October 27, 2009 Solution Set 5 Problem 1 Both recursive languages and recursively enumerable languages are closed under intersection. Any recursive language is accepted by a TM that is guaranteed to halt after a finite number of steps, whether or not the input string is in the language. Any recursively enumerable language has a TM that will eventually halt in an accepting state when run on any input that is in the language. To compute L 1 intersectiontext L 2 , we can construct a TM that first simulates the TM for L 1 , then simulates the TM for L 2 , and halts in an accepting state if and only if both simulated TMs halt in accepting states. If L 1 and L 2 are both recursive, then both simulations are guaranteed to halt after a finite number of steps, so the combined TM for L 1 intersectiontext L 2 also halts after a finite number of steps. Note that any input that is in L 1 intersectiontext L 2 is also in both languages L 1 and L 2 . If L 1 and L 2 are both recursively enumerable, then when run on an input that is in L 1 intersectiontext L 2 , both simulations will halt in an accepting state, meaning that the combined TM for L 1 intersectiontext L 2 will also halt in an accepting state. Problem 2 Let L denote the language described in the problem statement. The language L is undecidable, but it is recursively enumerable. To show that L is undecidable, we do a proof by contradiction using a reduction from L u . Suppose that L is decidable, meaning that there exists a TM M L that is an algorithm for L . Given an input ( M,w ) , we would like to decide if ( M,w ) L u , i.e. if the TM M encoded by the string ( M ) would accept the input w . To do so, we first construct a new machine M that uses tape alphabet = { , 1 , 2 ,B } and does the following: simulate the execution of machine M on input w (using only tape symbols 0, 1, and B to perform the simulation), and if the simulation halts in...
View Full Document

## This note was uploaded on 01/12/2010 for the course CS 154 at Stanford.

### Page1 / 3

sol04 - CS 154 Intro. to Automata and Complexity Theory...

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

View Full Document
Ask a homework question - tutors are online