(REVISED COURSE) (fJJ [Total Marks: 100 papers/TE/sem5/Computer/Theory of...4. Solve the followings...

3
1- 'Iot/o!!!; '-.~ \')'M'~ by.N" \fR.-SttS \;) V.Ex~J.0'9.G~Scan.33 rr~ f. CCD~) Se"f03C c?--) ~ eOi <=-j-i(c..' C O'(\\,?\l :tei Gc \e\\ce (REVISED COURSE) (3 Hours) Con. 3433-09. ~ (fJJ [Total Marks: 100 1 N.B.: (1) Question No.1 is"'compulsory. (2) -Solve any four questions out of remaining six questions. . (3) All questions carry equal marks. (4) Assume suitable data if required. (5) Figures to the right indicate full marks. 1. Solve thefollowings :- . :'$1 (a) State the pumping lemma for regular language and prove that L = { 02nIn 2: 1 }is not . regular. '(b), Design a Mealy machine that accepts an input from (0 + 1)*, if the input ends in '101, output A; if the input ends in 110, output B ; otherwise C. (c) Let G = (V, T, P, S) be the CFG having following set of productions. Derive the string "aabbaa" using leftmost derivation and rightmost derivation. S ~ aAS Ia A ~ SbAI SSI ba (d) Write a short note on Universal Turing Machine. 2. Solvethe followings:- (a) Construct an NFA with E - movesfortheregularexpression10(0+ 01 + 0110)* 6 (b) Find the equivalent DFA accepting the regular language defined by the right linear 14 grammar gIven as- S~ aA I bB A ~ aA I bG Ia B~aBlb C~bB 3. Solve the followings :- (a) Given a CFG G, find G' in Chomsky normal form generating L(G) - E.- S ~ASB IE A~AaS I a B~ SbSIAI bb (b) Construct left linear and right linear grammar for the regular expression «(01 +. 10)* 11)* 00)*. (c) Write short note on ambiguity resolution. 5 5 5 5 10 6 4 www.campuskeeda.com www.campuskeeda.com

Transcript of (REVISED COURSE) (fJJ [Total Marks: 100 papers/TE/sem5/Computer/Theory of...4. Solve the followings...

1-'Iot/o!!!;'-.~ \')'M'~ by.N"\fR.-SttS

\;) V.Ex~J.0'9.G~Scan.33 rr~ f. CCD~) Se"f03C c?--)

~ eOi <=-j-i(c..' CO'(\\,?\l :tei Gc \e\\ce(REVISED COURSE)

(3 Hours)

Con. 3433-09.~

(fJJ [Total Marks: 1001

N.B.: (1) Question No.1 is"'compulsory.(2) -Solve any four questions out of remaining six questions.

. (3) All questionscarry equal marks.(4) Assume suitable data if required.(5) Figures to the right indicate full marks.

1. Solvethefollowings:- . :'$1(a) State the pumping lemma for regular language and prove that L = { 02nIn 2: 1 }is not

. regular.

'(b), Design a Mealy machine that accepts an input from (0 + 1)*, if the input endsin '101, output A; if the input ends in 110, output B ; otherwise C.

(c) Let G = (V, T, P, S) be the CFG having following set of productions. Derive thestring "aabbaa" using leftmost derivation and rightmost derivation.

S ~ aAS IaA ~ SbAI SSI ba

(d) Write a short note on Universal Turing Machine.

2. Solvethe followings:-(a) Constructan NFAwith E-movesfor the regularexpression10(0+ 01 + 0110)* 6(b) Find the equivalentDFAaccepting the regular language defined by the right linear 14

grammar gIven as-S ~ aA IbBA ~ aA IbG IaB~aBlbC~bB

3. Solve the followings :-

(a) Given a CFG G, find G' in Chomsky normal form generating L(G) - E.-S ~ASB IE A~AaS Ia B ~ SbSIAI bb

(b) Construct left linear and right linear grammar for the regular expression«(01 +. 10)* 11)*00)*.

(c) Write short note on ambiguity resolution.

5

5

5

5

10

6

4

www.campuskeeda.com

www.campuskeeda.com

4. Solve the followings :-

(a) Design a PDA for CFL that checks the well formedness of parenthesis i.e. thelanguage L of all "balanced" string of two types of parenthesis say "( Y' & "[ ]".Trace the sequence of moves made corresponding to input string ( ([ ]) []).

(b) Construct a PDA that will accept a CFL generated by the following :-CFG G = (~ T, P, S) having the following set of productions--

S ~AB IABCA ~ BA I BC I E I aB ~ AC ICBIb I E

. C ~BC lAB Ic

(c) Give context free grammar generating the following sets.(i) The string containing no consecutive 'b's but 'a's can be consecutive.

(ii) The set of all strings over alphabet {a, b} with exactly twice as manya's as b's. .

8

8

4

rTTTD1\.T £\'TUD

www.campuskeeda.com

www.campuskeeda.com

www.campuskeeda.com

www.campuskeeda.com

Con.. 3433-VR-5ll 5-09. 2'-.

5. Solve the followings :- ,,..'(a) Construct a Turing machines M to accept the language L = {wcwRIwe { 0, I } * 10

and wRmeans reverse ofw }. Trace the sequence of moves made correspondingto input string OlelO

(b) Construct a turing machine M for performing proper subtraction m-n is defined 10to be m-n for m > n and zero for m < n. The TM started with omI0" on its tape,halts with om-" on its tape. Trace the sequence of moves for the input string0000100. .

6. Solve the followings :-

(a) Give the context .free grammar for the language N(M) where-M = ( { qO,ql }, { 0, I }, { X, ZO }, 0, qO,ZO,cp),where 0 is given byo(qO,0, ZO)= { (qO,XZO) }, o(ql, I, X) = { (qt, e) }

. o(qO,0, X) = { (qO,XX) }, o(ql, e, X) = { (ql, e) }o(qO, I, X) = { (ql, e) }, o(ql, e, ZO)= { (ql, e) }

(b) Writedowhthe minimizationalgorithmand using it findout the minimumstate finite 10. automaton equivalent to the transition table given below.

~--+A B . CD. E . F G H1 E F H H I B'B C

10

*- I-A

E

7. Solve the followings :- .

(a) Explain the undecidability of PCP ? Does PCP with following two list-A = (10,011, 101) and B = (101,11,011) have a solution '? Justify your answer.

(b) Write short note on Recursive Decent Parser.

(c) Find a Greibach normal-form grammar equivalent to the following CFG.A~Bb IBB B ~AB Ia S ~BAI ab

(d) Give DFAaccepting the following languages over the character (0, I)(i) The set of all strings ending in 00.

(ii) The set of all strings with three consecutive zeros.

6

4 .

6

4

www.campuskeeda.com

www.campuskeeda.com

www.campuskeeda.com

www.campuskeeda.com