TOC2
TOC2
TOC2
B.Tech II Year II Semester (R15) Regular & Supplementary Examinations October/November 2020
FORMAL LANGUAGES & AUTOMATA THEORY
(Computer Science & Engineering)
Time: 3 hours Max. Marks: 70
PART – A
(Compulsory Question)
*****
1 Answer the following: (10 X 02 = 20 Marks)
(a) Let A = {1, 3, 5, 6, 8, 9, 2} and B = {1, 2, 4, 5, 7, 8, 9, 10}.
Compute: (i) A – B. (ii) B – A. (iii) A ∪ B. (iv) A ∩ B.
(b) What is meant by proof by counter example? Give an example.
(c) Write regular expressions for the following languages over the alphabet {a, b}.
(i) All strings that do not start and end with 1.
(ii) All strings ending with 10.
(iii) All strings containing 10 as substring.
(iv) All strings that start with 10 and contains at least two consecutive 1’s.
(d) Construct FA equivalent to the regular expression 1(0+01)*1(0+1).
(e) What is left recursion in CFG? Give an example.
(f) What is a linear grammar? Give an example.
(g) Define Instantaneous description of a PDA. Give an example.
(h) Define DPDA and give an example.
(i) Define MPCP. Give an example.
(j) Define LBA. Give an example.
PART – B
(Answer all five units, 5 X 10 = 50 Marks)
UNIT – I
2 (a) Prove that the sum of cubes of first n natural numbers is (n(n+1)/2)2 using mathematical induction.
(b) Explain the Chomsky hierarchy of languages.
OR
3 (a) Convert the following NFA-Є to NFA.
(b) Write the procedure to convert a Moore machine into equivalent Mealy machine and apply your
procedure to the following Moore machine.
Contd. in page 2
Page 1 of 2
Code: 15A05404 R15
UNIT – II
4 State and prove pumping lemma for regular languages.
Using pumping lemma, prove that the following languages over the alphabet {0, 1} are not regular.
(i) Stings containing equal number of 0’s and 1’s.
(ii) Strings of the form 0n1n .i.e. n number of 0’s followed by the same number of 1’s.
OR
5 (a) Write the procedure for constructing FA from a given right linear grammar. Using the procedure,
construct FA equivalent to the following grammar.
S 0A / 1B / 0C A 0B / 0A / 0
B 1B / 0C / 0B C 0 / 1 / 1C / 0C
(b) Discuss about any five closure properties of regular languages.
UNIT – III
6 (a) Define ambiguity in a CFG. Show that the following grammar is ambiguous:
E E+E / E*E / (E) / a
Find the grammar which is unambiguous and equivalent to the above grammar.
(b) List any five decision problems related to the CFGs/CFLs along with the solution.
OR
7 Convert the following context free grammar to Greibach normal form:
S -> AAA / B
A ->aA /B
B ->∈.
UNIT – IV
8 Write the procedure to construct PDA that recognizes the language generated by the given CFG.
Using the procedure, find the PDA recognizing the language generated by the following CFG.
S ABa / BAb / AB A a / BA / BB B b / AB / AA
Show the derivation in the grammar and the moves of the PDA for the string bbaa.
OR
9 (a) Design a PDA for accepting the language of palindromes over the alphabet {0, 1, 2}. Show the
moves of the PDA for the string 210012.
(b) Explain in brief about two stacks PDA.
UNIT – V
10 Construct a TM recognizing.
L = { xxr / x Є {0, 1, 2}* and xr is the reverse of string x}
Show the moves of the TM for the string 201102.
OR
11 Write short notes on the following:
(a) Universal Turing Machine.
(b) Undecidability.
(c) Two stack PDA and TM.
*****
Page 2 of 2