hw9-solutions - CS 381 HW 9 Fall 2006 Solution to Problem 1...

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

View Full Document Right Arrow Icon
CS 381 HW 9 Fall 2006 Solution to Problem 1 1. We construct a turing machine that lists all possible strings in the alphabet in order and simulates the turing machine M on each of the possible strings; the machine lists each string accepted by M. Since M may not halt on some strings it does not accept, we have to interleave the simulations. If w 0 ,w 1 ,w 2 … are the strings in the alphabet, in round k we simulate each string w i i <= k for (k – i) steps; once a string is accepted, we of course remove that string from the list of strings to be simulated. For example, in round 1 we run M on w1 for just 1 step; then in the next round we run M on w1 for 2 steps and on w2 for 1 step and so on.
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS 381 Homework #9 Solutions 2. Show that {a n b n c n d n e n f n g n h n | n 1} can be written as the intersection of two context- free languages. { a i b i c j d j e k f k g l h l | i,j,k,l 1} I { a*b m c m d o e o f p g p h* | m,o,p 1} Both languages are context-free, because only two numbers are being compared at a time
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

hw9-solutions - CS 381 HW 9 Fall 2006 Solution to Problem 1...

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

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