*4459255* [4459] 255 Seat No. T.E. (Computer Engineering) (Semester I) Examination, 2013 THEY OF COMPUTATION (2008 Course) Time : 3 Hours Max. Marks : 100 Instructions : 1) Answers to the two Sections should e written in separate ooks. 2) Assume suitale data, if necessary. SECTION A 1. a) Give formal definitions of following with suitale examples :Epsilon closure, Non-Deterministic Finite Automata and Deterministic Finite Automata. 5 ) Define Mealy Machine. Construct a Mealy Machine which can output EVEN/ ODD if the total numer of 1 s in the input is even or odd. The input symols are 0 and 1. 5 c) Construct taular minimum state automata for following automata. State/ a q 0 q 0 q 7 q 7 P.T.O.
[4459] 255-2- *4459255* 2. a) Construct Moore machine equivalent to Mealy machine M given in the following tale : Next State Present State a State Output State Output a a ) Convert given non-deterministic finite automata (NFA) to deterministic finite automata (DFA). Informally descrie the language it accepts. δ 0 1 p {p,q} {p} q {r} *r {p,r} {q} c) Give non-deterministic finite automata to accept the following language over {0, 1}* The set of all strings containing either 101 or 110 as a sustring. 4 3. a) Construct minimized DFA accepting language represented y regular expression 0*1*2*. Convert given regular expression to NFA with ε moves and then covert NFA with ε moves to DFA using direct method. 8 ) Explain the application of regular expression to lexical analysis phase of compiler with suitale example. c) Give formal definition of regular expression and regular set. 2
*4459255* -3- [4459] 255 4. a) Using Arden s theorem, find the regular expression for the automata shown in the diagram. ) i) Write regular expression for following languages over {0, 1}* : The set of strings that egin with 110 The set of all strings not containing 101 as a sustring. ii) Give English description of the language of the following regular expression ( 1+ ε) (00 * 1)* 0 *. c) Prove or disprove each of the following aout regular expression : 1) (RS + R)*RS = (RR*S)* 2) (R + S)* = R* + S*. 4 5. a) Find a grammar in Chomsky Normal Form equivalent to the grammar S ~ S [S S] p q where S is the only variale. ) If the grammar G is given y production S asa S aa ε, show that any string in L(G) is of length 2n, n >= 0 the numer of strings of length 2n is 2 n. 2 c) State Pumping Lemma and use it to prove that language L = {a wherem is prime} is not regular language and not context free language. 10. a) Reduce the following grammar to Chomsky Normal Form : m S 1A 0B A 1AA 0S 0 B 0BB 1S 1
[4459] 255-4- *4459255* ) Derive (a101 + 1)*(a1 + ) using leftmost and rightmost derivation where grammar is given as E I, E E + E, E E*E, E (E), I a, I, I Ia, I I, I I0, I I1. Test whether the grammar is amiguous. c) Explain the application of context free grammar to syntax analysis phase of compiler with suitale example. SECTION B 7. a) Give formal definition of : Pushdown automata (PDA) Acceptance y PDA in terms of final state Acceptance y PDA in terms of null store Instantaneous description of PDA. ) Construct a context free grammar which accepts N(A), where A = ({q 0, }, {0, 1}, {Z 0, Z}, δ, q 0, Z 0, φ where δ is given y, 1, Z 0, Z Z 0 )}, ε, Z 0, ε )}, 1, Z, Z Z)}, 0, Z) = {(, Z)} δ (, 1, Z) = {(, ε )} δ (, 0, Z 0, Z 0 )} 12 n m n 8. a) Construct a pushdown automata A accepting L { 0 1 0 m, n >= 1} =. 7 ) Convert the grammar to PDA that accepts the same language y empty stack S S0S1S0S S0S0S1S S1S0S0 S ε c) Define deterministic PDA, compare deterministic PDA with non deterministic PDA. 5
*4459255* -5- [4459] 255 9. a) Design using transition tale a Turing machine that can accept the set of all even palindromes over {a, }. ) Explain in detail concept of Universal Turing Machine and extensions to asic Turing Machine. c) Give formal definition of : i) Post machine ii) Move relation of Turing Machine. 4 10. a) Design taular post machine to accept a language L = {(01) n 0 n, n >= 0} and test the design for two different inputs. 8 n n n ) Design a Turing Machine M to recognize the language { 1 2 3 n 1} >=. c) Justify whether PM = TM, where PM is Post Machine and TM is Turing Machine. 2 11. a) Justify Halting Prolem of Turing machine is undecidale. 5 ) Explain in detail Chomsky Hierarchy stating the types of grammars, types of machines and types of languages. c) Prove If L is recursive language so is its complement L c. 5 12. a) Define recursive and recursively enumerale language along with example. 4 ) Explain in detail Post Correspondence Prolem and Modified Post Correspondence Prolem with suitale example. c) Prove It is undecidale whether a CFG is amiguous. B/II/13/