CSE 350 Spring 2010 HW #5
1. Shift the string by 1 character: Read a character, move right, read another character, write the ﬁrstcharacter, move to the right. Repeat until it reads a blank, which then write the character on thatblank.2. Move the head right until the blank, mark the ﬁrst seen unmarked 1, mark ﬁrst and second seenunmarked 0 on the way. There are 3 possible orders, each need 3 states. If it reaches a blank before itmarked two 0 and a 1. Accept.3. Move left until the blank, if it didn’t see any unmarked 0 and 1 on the way, reject. Else do 2.
can’t be recognized. The machine can only store ﬁnite amount of information in the states. Itcan’t keep track of all possible amount of 0 it saw, and it can’t go back to check it. It is at least as powerfulas a DFA, the description of the machine itself is a DFA with epsilon transitions. A NFA can simulate thismachine. Every time the machine move right, it is a transition on the NFA that move to another state suchthat it’s not a epsilon transition. Every time the machine stop, or write something, it is a NFA doing aepsilon transition. So it is equvalent as a DFA.
If the queue automation(QA) can be simulated by a TM and the other way around, then the language canbe reconized by a QA iﬀ it is Turing-recognizable.To simulate a QA is easy with a multitape TM. One tape is QA’s queue, and one tape is QA’s input.Everytime it read a input, it can pop the queue by remove the ﬁrst symbol. It can push by move the queuetape to the ﬁrst blank and add a symbol.Use QA to simulate TM.Push a symbol for the starting of the input
on the queue. Add the entire input into the queue by pushingevery symbol it sees until the blank.Move Right: Move right(and replace the symbol) in TM is for the QA to move the queue such that thesymbol in the beginning of the queue (or the replaced version) move to the symbol in the end. This is popthe symbol, replace it, and push it back.Move Left: Because the queue can have states, therefore it have the ability to remember a constantamount of data. Suppose it remember 2 variables
.1. Pop a symbol, let
be that symbol. Push
. If there is a replacement rule, replace the symbol thenstore into
. If it is
, go to 5.2. Pop a symbol, let
be that symbol.3. If
into the queue, then set
and go to 2. Else continue.4. Push