20 likes | 128 Views
Finite state control with a 4-way read/write head. 8 8 8. 8. 8. 8. 8. 8. 8. 8. 8 8 8. Figure (a). Figure (b). Homework #3 (Models of Computation, Spring, 2001) Due : Section 1; February 8 (Thursday) Section 2; February 9 (Friday).
E N D
Finite state control with a 4-way read/write head 8 8 8 8 8 8 8 8 8 8 8 8 8 Figure (a) Figure (b) Homework #3 (Models of Computation, Spring, 2001)Due: Section 1; February 8 (Thursday) Section 2; February 9 (Friday) 1. (a) We know how to formally define a Turing machine with one-dimensional (1-D) tape and a finite state control with one two-way read/write head. How will you extend this definition and define a 2-D Turing machine with one two-dimensional tape and a finite state control with one read/write head that can move up, down, to the left, to the right, or stay? (See Figure (a) below.) Write a complete formal definition of such computational model with a tuple (i.e., set of information) as we did for the Turing machines. (b) Design a 2-D Turing machine which draws a figure of eight with 8’s on the blank tape as show in Figure (b) below. The machine should be in an accepting state when it has completed the drawing. What is the minimum number of states needed for this machine? Why? Your answer for this question will be evaluated according to the soundness of your argument. (over)
2. For each of the following languages Li construct a DPDA (deterministic pushdown automaton) which accepts Li. For your answer it it enough to show the state transition graph of the automaton. (Make sure if your machine does not have a bug by running it with several short input strings.) (a) L1 = {aibj; | i > j > 0 } (b) L2 = {aibj; | i j > 0 } (c) L3 = {aibj; | i j 0 } (d) L4 = {aibj | i > j > 0 } (e) L5 = {aibj | i j > 0 } (f) L6 = {aibj | i j 0 } (g) L7 = { aibkci | i, k > 0 } (h) L8 = { aibkci | i, k 0 } Notice: - Every string in the language of parts (a), (b) and (c ) ends with a semicolon ‘;’. - The machine is not allowed to read a blank from the tape cell next to the rightmost input symbol to check that all the input has been processed. - Recall that by definition, the input string is accepted if and only if both of the following conditions are satisfied. (1) The machine is in an accepting state. (2) The whole input string has been read. 3. For each of the following grammars, construct a DPDA which accepts the language generated by the grammar, where S is the only nonterminal, and others are all terminal symbols. For your answer it it enough to show the state transition graph of the automaton. (a) G1: S aSbb | abb (b) G2: S aSbb | (c ) G3: S aSbb | ccc 4. For each of the following languages, construct a DFA (deterministic finite automaton) which accepts the language. For your answer it it enough to show the state transition graph of the automaton. (a) L9 = {x | x {a, m, t, o, u}* and x has automata as a substring. } (b) L10 = {x | x {a, b, c}+ , and the leftmost and the rightmost symbols in x are same.}