Академический Документы
Профессиональный Документы
Культура Документы
USN 1 M
M S RAMAIAH INSTITUTE OF TECHNOLOGY (AUTONOMOUS INSTITUTE, AFFILIATED TO VTU) BANGALORE - 560 054
Instructions to the Candidates: Answer one full question from each unit.
UNIT-I 1. a) Define the language of a DFA . the string 01010 belongs to L. b) Construct an NFA to accept string from the language L = {ws{a,b}* J w (04) begins or ends with as or bb} c) Convert the NFA in Fig 1( c) into an equivalent DFA. (08) Construct a DFA to recognize (08)
L = {x s {0,1}* I IxI > 2} and the 2d symbol from right is 1 } . Show that
2. a) Construct a DFA to accept binary numbers divisible by 4 and start (06) with 1. Show that 1100 is divisible by 4. b) Prove that a language L is accepted by a NFA if and only if L is (05) accepted by some DFA.
c) Convert the s-NFA in Fig 2(c) to DFA. (09) 0..
Page 1 of 4
CS401
UNIT-II 3. a) Write regular expressions corresponding to the following languages (04) over J {0,1}
c) State and prove the pumping lemma for regular languages show that (10) the language.
L = 10 f P is a prime } is not regular.
4. a) Prove that regular languages are closed under intersection. Given are (06) 2 DFA's M1 and M2 accepting the languages L1 and L2 respectively. Construct a DFA accepting the language L1 nL2
0'1
Page 2 of 4
CS401
c) Write a note on the applications of regular expressions. (04) UNIT-III
5. a) Give CFGs that generate the following languages over {0,1} (06) i) L, _ {ws{0,1}*1 wstarts and ends with the same symbol} ii) L2 = {we{0,1}*I length of wis odd and its middle symbol is 0 }
b) What is an ambiguous grammar? Is the grammar (06) S- *a (Sa jbSSj SSbjSbS ambiguous? Justify your answer.
c) Design a PDA to accept the language {0"1, on I m,n>1} Trace the (08) moves of the PDA on the string 00100. 6. a) Define CGF . {a`b' ( j:5 2i} b) Design a PDA to accept the language L = {a`b'ck j i = j or j = k}. Show (08) the moves of the PDA on the string abbcc. c) Describe how a PDA can be constructed to accept the language of a (07) CFG. Find a DFA to accept the language of the grammar S--aABBlaAA , A->aBBIa , B-*bBBIA. UNIT-IV 7. a) Prove that if L is a regular language , then L = L(p) for some DPDA P. (04) b) Given the grammar S-*ASB/s, A-*aAS/a, B-*SbS/AIbb (12) i. Eliminate s-productions Design a content free grammar for the language (05)
ii. Eliminate any unit productions in the resulting grammar iii. Eliminate any useless symbols in the resulting grammar iv. Put the resulting grammar into Chomsky normal form c) Use the pumping lemma for context-free languages to prove that (04) L = {0"1"2" 1 n _> 1} is not context-free.
8. a) Define deterministic PDA. Obtain a DPDA to accept the language of (08) all balanced strings involving two types brackets { } and [ I
b) Find a CFG without E-productions equivalent to the grammar defined (06) by S- *ABaC, A-).BC, B--->b/s, GAD/E, D->d c) Prove that the language L = {ww I we{0,1} *} is not context-free. (06)
Page 3 of 4
CS401
UNIT-V 9. a) Design a Turing machine to accept the set of strings with an equal (10) number of 0's and 1 's Show the computation on input "0011". b) Define
(06)
10. a) What is a Turing machine subroutine? How does a TM call a (12) subroutine? Design a TM to implement the function multiplication using a subroutine. b) Define Post's correspondence problem. Does the following instance of (05) PCP have a solution? i B A
w;
v;
1 11 111 2 100 001 3 111 11 c) Bring out the relationship between the recursive, . recursively (03) enumerable (RE) and non-RE languages.
***************