# hw7sol - CS 181 Winter 2008 Formal Languages and Automata...

• Homework Help
• 3

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

CS 181 — Winter 2008 Formal Languages and Automata Theory Problem Set #7 Solutions Problem 7.1. (10 points) A useless state in a Turing machine is one that is never entered on any input string. Consider the problem of determining whether a Turing machine has any useless states. Formulate this problem as a language and show that it is undecidable. Solution We formulate this problem as the following language: US TM = {h M i | M is a Turing machine with a useless state } . We will show that US TM is undecidable via a reduction from the language E TM . Recall that E TM = {h M i | M is a Turing machine with L ( M ) = ∅} . Assume, by way of contradiction, that US TM is decidable and let D be a decider for it. Now suppose we wish to decide whether or not some Turing machine M has an empty language (i.e. whether or not h M i ∈ E TM ). Notice that M has an empty language if and only if its accept state q accept is useless. However, we can only use D to find if any of the states (not just q accept ) are useless. Thus, we will need to construct a Turing machine M 0 whose language is exactly that of M , but guarantees that all non-accepting states are not useless. We construct M 0 by starting with M and adding transitions. Let be a tape symbol not used by M . Then for each state q Q where q 6 = q accept , M 0 has the ability to go from q 0 to q by writing to the tape (regardless of what tape symbol is read) and keeping the head in the same position. Since did not appear in M , no accepting run of M 0 will use these transitions. However, the existence of these transitions guarantee that every state, other than q accept , is not useless.

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

This is the end of the preview. Sign up to access the rest of the document.
• Spring '08
• griebach
• Halting problem, U STM

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern