Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
cse350hw5

cse350hw5

Ratings: (0)|Views: 17 |Likes:
Published by Chao Xu

More info:

Published by: Chao Xu on Apr 08, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/20/2012

pdf

text

original

 
CSE 350 Spring 2010 HW #5
Chao Xu(106978083)
3.8c
1. Shift the string by 1 character: Read a character, move right, read another character, write the firstcharacter, 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 first seen unmarked 1, mark first 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.
3.13
{
0
k
1
k
|
k >
0
}
can’t be recognized. The machine can only store finite 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.
3.14
If the queue automation(QA) can be simulated by a TM and the other way around, then the language canbe reconized by a QA iff 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 first symbol. It can push by move the queuetape to the first 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
x
and
y
.1. Pop a symbol, let
x
be that symbol. Push
. If there is a replacement rule, replace the symbol thenstore into
x
. If it is
, go to 5.2. Pop a symbol, let
y
be that symbol.3. If 
y
is not
, push
x
into the queue, then set
x
=
y
and go to 2. Else continue.4. Push
then push
x
1

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->