You are on page 1of 22

Code: 15A05404

R15
B.Tech II Year II Semester (R15) Regular Examinations May/June 2017
FORMAL LANGUAGES & AUTOMATA THEORY
(Computer Science and Engineering)
Time: 3 hours Max. Marks: 70
PART – A
(Compulsory Question)
*****
1 Answer the following: (10 X 02 = 20 Marks)
(a) Define a DFA formally.
(b) Differentiate between a Moore machine and a mealy machine.
(c) What are various forms in which we can represent regular languages?
(d) Construct a DFA that accepts strings which does not contain a substring of 110.
(e) State and prove ARDEN’s theorem.
(f) When do we say a CFG is in Greibach Normal Form?
(g) Compare and contrast DPDA and NPDA.
(h) State the properties of LR grammars.
(i) Write short notes on Linear Bounded Automata.
(j) List the closure properties of Recursively Enumerable Languages.

PART – B
(Answer all five units, 5 X 10 = 50 Marks)
UNIT – I
2 Convert the following mealy machine into its equivalent Moore machine.
From state i/p To state o/p i/p To state o/p
Q0 0 Q1 N 1 Q3 N
Q1 0 Q2 N 1 Q3 N
Q2 0 Q2 Y 1 Q3 N
Q3 0 Q1 N 1 Q4 N
Q4 0 Q1 N 1 Q4 Y
OR
3 Minimize the following automata.

UNIT – II
4 Prove that the language p is a prime number is not regular.
OR
5 (a) Explain how equivalence between two FA is verified with an example.
(b) What are the applications of regular expressions and finite automaton?
Contd. in page 2

Page 1 of 2
Code: 15A05404
R15

UNIT – III
6 Convert the following grammar into Greibach Normal form:

OR
7 Explain the closure properties of Context Free languages.
UNIT – IV
8 Construct a PDA that recognizes balanced parentheses.
OR
9 Construct a PDA that recognizes strings of type aibjci+j.
UNIT – V
10 Construct a Turing machine which carries out proper subtraction (a-b=0, if a<b).
OR
11 (a) Explain Chomsky Hierarchy of languages.
(b) Explain any four variations of Turing machines.

*****

Page 2 of 2
Code: 15A05404
R15
B.Tech II Year II Semester (R15) Supplementary Examinations December 2017
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) Define symbol, string and language.
(b) Differentiate between DFA and NFA.
(c) Draw DFA that accepts strings which has a substring of 101 over an alphabet {0, 1}.
(d) Differentiate between left and right linear grammars.
(e) Justify the statement CFLs are note closed under intersection with an example.
(f) Draw derivation tree for the string id+id* id from the grammar id.
(g) Formally define a push down automata.
(h) Briefly explain when we call a CFG is in Chomsky’s normal form.
(i) List the closure properties of recursive languages.
(j) Briefly explain the functioning of a counter machine.

PART - B
(Answer all five units, 5 X 10 = 50 Marks)
UNIT - I
2 Convert the following NFA with moves to NFA without moves.

2 3 4 5 6

10
1

7 8 9

OR
3 Construct a DFA for the regular expressions 10 + (0 + 11) 0*1 and optimize the states.

UNIT - II
4 Prove that is a perfect square is not a regular language using pumping lemma.
OR
5 List and explain the closure properties of regular languages.
Contd. in page 2

Page 1 of 2
Code: 15A05404
R15

UNIT - III
6 (a) Simplify the following grammar.

(b) Remove left recursion from the grammar


OR
7 (a) Define Ambiguous grammar.
(b) Remove ambiguity from the grammar .

UNIT - IV
8 Construct a pushdown automaton that recognizes even length palindromes over an alphabet {0, 1}.
OR
9 Construct a PDA that recognizes strings which contain equal number of 0’s and 1’s.

UNIT - V
10 Construct a Turing machine which multiplies two unary numbers.
OR
11 (a) Define the Turing machine Halting problem.
(b) Define the post correspondence problem.
Let and take A and B as .
Give a PCP solution for this problem. If we take
. Then, is there PC solution exist. Justify your answer.

*****

Page 2 of 2
Code: 15A05404 R15
B.Tech II Year II Semester (R15) Regular & Supplementary Examinations May/June 2018
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) What is induction principle? Give an example.
(b) Draw finite automata that accept a string start with ‘1’ and ends with ‘0’, Σ = {0, 1}.
(c) Construct a regular expression that accepts 3rd symbol from right end as ‘a’.
(d) Define Arden’s theorem.
(e) Construct the language L for S→aCa, C→aCa/b.
(f) Give the general forms of CNF.
(g) What is instantaneous description of PDA?
(h) Draw push down automata that accept the language L = {anbn/n≥1}.
(i) Differentiate multi tape and multi track turing machine.
(j) List the properties of recursively enumerable language.

PART – B
(Answer all five units, 5 X 10 = 50 Marks)
UNIT – I
2 Determine minimal deterministic finite automata (DFA) for the given transition table over Σ = {0,1}, where
A is the initial state and C is the final state
Symbol
0 1
state
→A F B
B C G
C* C A
D G C
E F H
F G C
G E G
H C G
OR
3 Construct DFA equivalent to NFA
µ = ({p,q,r}, {0,1), δ, p, {q,s})
Where δ is defined in the following table:
δ 0 1
p {q,s} {q}
q* {r} {q,r}
r {s} {p}
S* - {p}
UNIT – II
4 Find whether the languages {ww/w is in (1+0)*} and {1k / k = n2, n>=1} are regular or not.
OR
5 Construct an NFA for the regular expression (a+b)*aab(a+b)*
Contd. in page 2

Page 1 of 2
Code: 15A05404 R15

UNIT – III
6 For the given context free grammar (CFG) G, find Chomsky normal form (CNF). G has productions
S → AaA / CA / BaB
A → aaBa / CDA / aa / DC
B → bB / bAB/ bb / aS
C → Ca / bC / D
D → bD / b
OR
7 (a) Explain the closure properties of Context Free languages.
(b) Find the left most derivation and right most derivation to the following parse tree.

a S
A

S b A

a b a

UNIT – IV
8 Convert the grammar S→oAA, A→OS/1S/o to a PDA that accepts the same language by empty stack.
OR
9 Construct pushdown automata (PDA) for the following language:
L = {an+1 bn : n≥0}
Draw the transition diagram trace the string ‘aaaabbb’.
UNIT – V
10 Design a Turing machine for the given language L = {0n13n : n≥1}. Write the transition table for the turning
machine and show the tracing of string 00111111.
OR
11 Prove that Ld is not recursively enumerable.

*****

Page 2 of 2
Code: 15A05404 R15
B.Tech II Year II Semester (R15) Supplementary Examinations December 2018
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) Define inductive proof.
(b) Differentiate NFA and DFA.
(c) Write the regular expression to denote a language L which accepts all the strings which begin or end with
either 00 or 11.
(d) State the pumping lemma for regular language.
(e) If 𝛿 → 𝑎δ𝑏/𝑎𝐴𝑏, 𝐴 → 𝑏𝐴𝑎, 𝐴 → 𝑏𝐴𝑎, 𝐴 → 𝑏𝑎. Find the language generated by the grammar.
(f) Generate context free grammar L={w/w contain at least three a’s}.
(g) What do you mean by instantaneous description for push down automata?
(h) Mention the normal forms of context free grammar. Justify the need of normal forms.
(i) Draw transition diagram of the tuning machine to recognize all strings consisting of an even number of
1’s over ∑={1}.
(j) Distinguish between regular languages and recursively enumerable languages.

PART – B
(Answer all five units, 5 X 10 = 50 Marks)
UNIT – I
2 Convert the following NFA to DFA.
0 1
→p p, r q
q r, s p
*r p, s r
*s q, r ¢
OR
3 Minimize the finite automaton shown in figure below.

q1 1
0 0,1
0 0
1
q2 q4
q0
1 0
q3 1

UNIT – II
4 Convert the following NFA into regular expression.

0,1
0,1 0,1
A B C D
i
OR
5 Summarize the closure properties of regular language.
Contd. in page 2

Page 1 of 2
Code: 15A05404 R15

UNIT – III
6 Find the CNF of the following grammar:
𝑆 → 𝑂𝐴𝑂�|𝐵|�𝐵𝐵
A→C
B→S/A
C→S/∈
OR
7 Show that the following grammars are ambiguous:
𝑆 → 𝑎𝑠𝑏𝑠/𝑏𝑠𝑎𝑠/𝜖
𝑆 → 𝐴𝐵/𝑎𝑎𝐵, 𝐴 → 𝑎/𝐴𝑎, 𝐵 → 𝑏.
UNIT – IV
8 Let M=({q0,q1}, {0,1}, {x,z0}, δ, q0, z0,¢) where δ is given by:
δ(q0,0,z0)=(q0,xz0)
δ(q1,1,x)=(q1,∈)
δ(q0,0,x)=(q0,xx)
δ(q1,∈,x)=(q1,∈)
δ(q0,1,x)=(q1,∈)
δ(q1,∈,z0)=(q1,∈)
Construct a CFG for the PDAM.
OR
9 Show that the language L={aibici / i≥1} is not context free language.

UNIT – V
10 Define post correspondence problem. Let Σ = {0, 1}. Let A and B be the lists of three strings each,
defined as:
List A List B
i wi xi
1 1 111
2 10111 10
3 10 0
Does this PCP have a solution?
OR
11 Design a Turing machine for multiplying two numbers using subroutine.

*****

Page 2 of 2
Code: 15A05404 R15
B.Tech II Year II Semester (R15) Regular & Supplementary Examinations May/June 2019
FORMAL LANGUAGES & AUTOMATA THEORY
(Computer Science and Engineering)

Time: 3 hours Max. Marks: 70


PART – A
(Compulsory Question)
*****
1 Answer the following: (10 X 02 = 20 Marks)
(a) Distinguish between DFA and NFA.
(b) Prove that for all n ≥ 1, 8n – 3n is divisible by 5.
(c) Write regular expressions for the following languages over {0, 1}*.
(i) The set of all strings that begin with 01 and end with 11.
(ii) Set of all strings not containing 110.
(d) Define pumping lemma for regular languages.
(e) What is sentential form of a grammar? Give an example.
(f) Consider the following context free grammar and construct the parse tree for the string 10011001:
S → 0/1/0S0/1S1/∈.
(g) What is instantaneous description of Pushdown automata? Give an example.
(h) Design PDA for the language L = {0𝑛 𝑏𝑛+1 |𝑛 ≥ 1}.
(i) Distinguish between recursive language and recursive enumerable language.
(j) Find a solution to following PCP instance.
i List A List B
1 10 100
2 011 1
3 101 1011
4 001 1001

PART – B
(Answer all five units, 5 X 10 = 50 Marks)
UNIT – I
2 (a) Prove the following statement by induction: For n ≥ 5, 4𝑛 < 2𝑛 .
(b) Convert the given NFA to equivalent DFA.
𝛿 0 1
→ p {p, q} {p}
q Ø {r}
*r {p, r} {q}
OR
3 Find the equivalent NFA without 𝜀 moves.
𝛿 a b c 𝜀
→ p Ø {q} {r} {q, r}
q {p} {r} {p, q} Ø
*r Ø Ø Ø Ø

Contd. in page 2

Page 1 of 2
Code: 15A05404 R15
UNIT – II
4 Obtain a regular expression for the following finite automata using Arden’s theorem.
𝛿 0 1
* → p {s} {p}
q {p} {s}
r {r} {q}
s {q} {r}
OR
5 (a) Find whether the language L = {wwR / where w from {a, b}*} is regular or not.
(b) Summarize closure properties of regular languages.
UNIT – III
6 (a) Design a CFG for the language L = {0 1 / n > = 1}. Show the derivation of string 0001 using the
n+1 n-1

grammar.
(b) Find out the language L is context free language or not using pumping lemma. L = {an bn cn / n >= 1}.
OR
7 Convert the following context free grammar to Greibach normal form:
S -> AAA / B
A ->aA /B
B ->∈.
UNIT – IV
8 (a) Design Pushdown automata for the language:
L = {x| x = wcwr and w is a string over {a, b}* }. Show the moves of PDA for abcba.
(b) Write the steps to convert the PDA which accepts the string by Final state to PDA which accepts the
string by empty stack.
OR
9 Convert the PDA P =( {p, q}, {0, 1}, {X,Z}, 𝛿, q, Z, p) to a CFG, if transition function is given by:
𝛿(𝑞, 1, 𝑍) = {(𝑞, 𝑋𝑍)} 𝛿(𝑞, 1, 𝑋) = {(𝑞, 𝑋𝑋)} 𝛿(𝑤, £, 𝑋) = {(𝑞, £)}
𝛿(𝑞, 0, 𝑋) = {(𝑝, 𝑋)} 𝛿(𝑝, 1, 𝑋) = {(𝑝, £)} 𝛿(𝑝, 0, 𝑍) = {(𝑞, 𝑍)}
UNIT – V
10 Design a Turing machine to perform proper subtraction of two non negative integers x and y.
Represent this Turing machine with its transition diagram and transition table. Proper subtraction
can be defined by the following function:
f(x, y) = x - y if x > = y
f(x, y) = 0 if x < y.
OR
11 Prove the following theorems:
(a) Let L be a language. If L and 𝐿� are recursively enumerable, then L is recursive.
(b) Let L1 and L2 be recursive languages over Σ. Then L1∩L2 is recursive.

*****

Page 2 of 2
Code: 15A05404 R15
B.Tech II Year II Semester (R15) Supplementary Examinations December 2019
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) Prove by induction: 1+ 2 + 3 +…..n = n (n+1)/2.
(b) What is the language accepted by following NFA?

(c) Write regular expression for the language that consists of set of all strings that contain 1011 as
substring over {0,1}*. Justify your answer.
(d) State Arden’s theorem.
(e) Define context free grammar. Give an example.
(f) Write the CFG for the following language and derive the string a3b4 from it.
𝐿 = {𝑎𝑛 𝑏𝑛+1 |𝑛 ≥ = 1}.
(g) Define instantaneous description of pushdown automata. Give an example.
(h) Design PDA for the language 𝐿 = {𝑎𝑛 𝑏𝑛 |𝑛 >= 1}.
(i) Distinguish between decidable languages and undecidable languages.
(j) Let Σ = {0, 1}. Consider A and B are the lists of three strings each. Find a solution to the following
PCP.
𝑖 List A List B
wi xi
1 10 101
2 011 11
3 101 011

PART – B
(Answer all five units, 5 X 10 = 50 Marks)
UNIT – I
2 (a) Prove the following statement by proof by counter example:
There is no pair of integers a and b such that “a mod b = b mod a”.
(b) Construct the equivalent DFA for the given NFA.
𝛿 a b
→𝑝 {p, q} {p}
q {r} {r}
r {s} ∅
*s {s} {s}
OR
3 Convert the given 𝜖 - NFA to DFA.
𝛿 a b c 𝜖
→ 𝑝 ∅ {q} {r} {q,r}
q {p} {r} {p, q} ∅
*r ∅ ∅ ∅ ∅
Contd. in page 2

Page 1 of 2
Code: 15A05404 R15
UNIT – II
4 (a) Find out whether the language L is regular or not. Where 𝐿 = {0𝑛 12𝑛 /𝑛 ≥ 1}.
(b) Construct a NFA for the regular expression (11+0)*(00+1)*.
OR
5 (a) Using Arden’s theorem, find regular expression that generates the language recognized by the
following FA.

0
0 1
𝑞0 1 𝑞1 1
𝑞2

(b) Discuss any five closure properties of regular languages.


UNIT – III
6 (a) What is ambiguous CFG? Check whether the following grammar is ambiguous or not.
𝑆 → 𝐴/𝐵
𝐴 → 0𝐴/𝜖
𝐵 → 1𝐵/0𝐵/𝜖
(b) Design a CFG for the language L = {WW R/w is formed over the string {a, b}}. Derive the string
aabbaa using left most derivation, right most derivation and parse tree.
OR
7 Define Chomsky Normal Form of a CFG. Write the procedure to find CNF for a given CFG:
Convert the following context free grammar to Chomsky normal form:
𝑆 → 𝐴𝑆𝐵/𝜖
𝐴 → 𝑎𝐴𝑆/𝑎
𝐵 → 𝑆𝑏𝑆/𝑎/𝑏𝑏
UNIT – IV
8 (a) Design Pushdown Automata (PDA) for the following language:
L = {w|𝑤 is a palindrome over {a, b}*} and show the moves of PDA for string abaaba.
(b) Convert the following Context Free Grammar (CFG) to equivalent pushdown automata:
𝑆 → 𝑎𝐴𝐴
𝐴 → 𝑎𝑆/𝑏𝑆/𝑎
Show the moves of the PDA for string aaa.
OR
9 Convert the given PDA 𝑃 = ({𝑞, 𝑟}, {𝑎, 𝑏}, {𝑋, 𝑍}, 𝛿, 𝑞, 𝑍, 𝑞) to a context free grammar. The transition
function is given by:
(i) 𝛿(𝑞, 0, 𝑍) = {(𝑞, 𝑋𝑍)}
(ii) 𝛿(𝑞, 0, 𝑋) = {(𝑞, 𝑋𝑋)}
(iii) 𝛿(𝑞, 1, 𝑋) = {(𝑟, 𝜖)}
(iv) 𝛿(𝑟, 1, 𝑋) = {(𝑟, 𝜖)}
(v) 𝛿(𝑟, 𝜖, 𝑍) = {(𝑟, 𝜖)}
UNIT – V
10 Design a Turing machine for the language 𝐿 = {𝑊𝑊 𝑅 /𝑊 ∈ {0,1} ∗}. Represent this Turing machine
with its transition diagram and transition table. Also verify whether the string 01011010 is accepted
by the Turing machine or not.
OR
11 Prove the following theorems:
(a) If L is recursive language, so is 𝐿∣ .
(b) Every regular language can be accepted by a Turing machine.

*****

Page 2 of 2
Code: 15A05404 R15
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
Code: 15A05404 R15
B.Tech II Year II Semester (R15) Supplementary Examinations April 2021
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) Draw the diagram showing the Chomsky hierarchy for grammars/languages.
(b) What do you mean by contra positive? Give an example.
(c) List any four closure properties of regular languages.
(d) Construct regular grammar equivalent to the regular expression: 1(01+0)*10.
(e) What is left factoring in CFG? Give an example.
(f) Define left most derivation in a CFG? Give an example.
(g) Define the two types of acceptance by PDA.
(h) Show the pictorial representation of the following move of a PDA:
(p, abcdZ) ⊢ (q, aabcdZ)
(i) Define Instantaneous Description of a TM. Give an example.
(j) What is PCP? Give an example.

PART – B
(Answer all five units, 5 X 10 = 50 Marks)
UNIT – I
2 (a) Prove that the sum of squares of first n natural numbers is n(n+1)(2n+1)/6 using mathematical
induction.
(b) Explain the following operations with suitable examples with respect to languages:
(i) Union. (ii) Intersection. (iii) Complement. (iv) Closure. (v) Difference.
OR
3 (a) Minimize the following FA.

(b) Convert the following NFA into equivalent DFA.

UNIT – II
4 (a) Discuss the applications of regular expressions.
(b) State and prove the pumping lemma for regular languages. Using pumping lemma, prove that the
language of palindromes over the alphabet {a, b, c} is not regular.
OR
Contd. in page 2

Page 1 of 2
Code: 15A05404 R15
5 (a) Construct regular grammar equivalent to the following FA.

(b) State any five decision problems with respect to Regular Languages and also discuss about the
solution to each.
UNIT – III
6 (a) Discuss any five closure properties of CFLs.
(b) State pumping lemma for CFLs. Using pumping lemma, prove that: L = { xxr / x Є {a, b}* and xr is the
reverse of string x} is not CFL.
OR
7 (a) Define GNF for a CFG. Obtain GNF for the following grammar:
S  aB / BaB / AB / AC A  aabb / aBbA / CB
A  a / Bb / BbCcAa B  aa / bb C  ab / ac / bc
(b) Write the procedure to eliminate null productions from a given grammar. Apply the procedure to the
following grammar to find the equivalent grammar without null productions.
S  ABC / BA / abC A  aa / BC / CB / AA / Є
B  AA / bb / aAB C  BC / BBbb / BA / cc
UNIT – IV
8 Write the procedure to construct CFG equivalent to a given PDA. Using the procedure, find the CFG
equivalent to the following PDA (Z0 is the initial stack symbol). Show the moves of the PDA and the
derivation using the grammar constructed by you for the string 01C10$.

OR
9 (a) Explain in brief about Deterministic push down automata.
(b) Construct a PDA which accepts the language defined by the following grammar:
SE+T/T T  T*F / F F  (E) / a
Show the moves of the PDA for the string a+a*a.
UNIT – V
10 (a) Construct a TM that recognizes the language generated by the regular expression ab*ba*a. Show
the moves of the TM for the string abbaaa.
(b) Write short notes on reducibility.
OR
11 (a) Construct a TM for computing the multiplication of two give positive integers. Show the moves of the
TM for the input (2, 3).
(b) Write short notes on the undecidable problems about TMs.
*****
Page 2 of 2
Code: 19A05501 R19
B.Tech III Year I Semester (R19) Regular Examinations February 2022
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) Define non-deterministic finite automata.
(b) Draw the digraph for the following: G = ({1, 2, 3, 4, 5, 6}, {i->j|i<j}).
(c) Define and explain Kleene Closure for regular expression.
(d) Construct a regular expression for the set of strings in (0+1)* such that any two 0’s are separated by
a string, whose length is 4i, for some i >=0.
(e) What is useless symbol in a grammar give an example?
(f) With example, explain left recursion.
(g) Give the formal definition of PDA.
(h) Define two stack PDA.
(i) Define Church’s thesis.
(j) Define post correspondence problem.

PART – B
(Answer all the questions: 05 X 10 = 50 Marks)

n(n+1)(2n+1)
2 (a) Prove that ∑𝑛𝑛𝑖𝑖=0 i2 = .
6
(b) Explain the steps to convert NFA to DFA. Illustrate with an example.
OR
3 (a) What is Mealy machine? Design Mealy machine for incrementing the value of any binary number
by one. The output should also be a binary number with value one more than the number given.
(b) Minimize the following DFA.

4 (a) Prove that the following language is non-regular:


L= {anbn | n>0}
Use Pumping Lemma.
(b) State and prove Pumping Lemma for regular languages.
OR
5 (a) Construct a DFA that accepts the language represented by 0*. 1*. 2*
(b) Briefly explain any two closure properties of RLs.

Contd. in page 2

Page 1 of 2
Code: 19A05501 R19

6 Convert the grammar G to Greibach normal form:


G = ({A1,A2, A3}, {a,b}, P,A)
Where P consist of:
A1 ->A2A3
A2->A3A1|b
A3->A1A2|a
OR
7 (a) Eliminate the unit productions from the following grammar:
S-> a | Xb | aYa | b | aa
X-> Y
Y-> b | X
(b) Convert the following grammar into CNF:
E → E+T/T
T → T∗ F/F
F → (E)/a/ab/ba

8 (a) Construct a PDA that accepts the following language L= { an bn n>=0 }. Show the moves of PDA
for aabb.
(b) Write about applications of PDA.
OR
9 (a) Explain DPDA and NPDA.
(b) Construct of PDA for recognizing the language generated by the following CFG:
S → AB│BA
A → aA│a
B → bB│b

10 Explain the following: (i) Composite TM. (ii) Halting problem of TM.
OR
11 Explain NP, NP Hard and NP complete problems.

*****

Page 2 of 2
Code No: RT22055 R13 SET - 1

II B. Tech II Semester Regular Examinations, April/May - 2016


FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science and Engineering)
Time: 3 hours Max. Marks: 70
Note: 1. Question Paper consists of two parts (Part-A and Part-B)
2. Answer ALL the question in Part-A
3. Answer any THREE Questions from Part-B
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PART –A
1. a) Construct a finite automata that accepts {0,1}+. (4M)
b) List out the properties of recursive and recursively enumerable language. (4M)
c) Differences between DFA and NFA with examples. (4M)
d) What is a regular set? Give examples for it. (3M)
e) How to remove Ambiguity from grammars? Explain with an example. (4M)
f) Define universal Turing machine and universal language. (3M)
PART -B
2. a) Construct a finite state automata that accepts the language {aibjck/i,j,k>0}. (8M)
b) What is a Finite state machine? Give the mathematical representation of FSM. (8M)
Explain each component.

3. a) Show that the language L= {anbncn: n≥0} is not context free. (8M)
b) Briefly explain about various operations on Strings with suitable examples. (8M)

4. Define the DFA and regular expression. DFA accepts all strings corresponding to (16M)
the expression 1*01(0+11)*. Also explain how to convert DFA to regular
expression by eliminating states.

5. a) Convert the following regular expression into NFA with ∈ transition. (8M)
i) 1*0+1101 ii) (0+1)*
b) Give the properties of regular expressions and state and prove Arden’s theorem. (8M)

6. Remove all ∈ and unit production rules from the following CFG (16M)
S  AaA/ CA/ BaB
A  aaBa/ CDA / aa / DC
B  bB / bAB / bb/ aS
C  Ca / bc / D
D  bD / A

7. a) Design a Turing machine that accepts the language L ={ WWR / W∈ (0+1)* and (10M)
WR is reverse of W}
b) What is post correspondence problem? Explain with an example. (6M)
1 of 1
Code No: RT22055 R13 SET - 2

II B. Tech II Semester Regular Examinations, April/May - 2016


FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science and Engineering)
Time: 3 hours Max. Marks: 70
Note: 1. Question Paper consists of two parts (Part-A and Part-B)
2. Answer ALL the question in Part-A
3. Answer any THREE Questions from Part-B
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PART –A
1. a) Construct a finite automaton that accepts {0,1}* (4M)
b) Write any one application of CFG with example. (4M)
c) What are the differences between DFA and NFA? (4M)
d) Obtain the regular expression to accept strings of a’s , b’s and c’s such that fourth (4M)
symbol from the right is a and ends with b.
e) Differentiate Chomskey and Gueibach normal forms (3M)
f) Role of Checking of symbols in a Turing machine. (3M)
PART -B
2. a) Construct a finite state automata that accepts those strings over {a,b} that contain (8M)
aaa as substring.
b) What is an Automaton? Give its classification. Give the applications of automata (8M)
in real world.

3. a) Write detail note on recursive enumerable languages with an example. (6M)


b) Compare and contrast between regular grammar and unrestricted grammar with (10M)
example.

4. a) Convert the regular expression (ab+aba)* to a NFA. (8M)


b) Construct a Non Deterministic Finite automaton (NDFA) with ∈-moves for the (8M)
regular expression (10+11)*00.

5. a) Briefly explain how to convert regular expression into Automata with an example. (8M)
b) Mention the differences between DFA, NFA and e-NFA. (8M)

6. a) Construct a Greibach Normal Form grammar equivalent to the following CFG (8M)
S  AA / 0
A  SS / 1
b) Prove that the following grammar of arithmetic expression is ambiguous. (8M)
E  E+E / E*E / (E) / (id)

7. a) Draw a transition diagram for Turing machine and explain it in detail. (6M)
b) Design a Turing machine to accept the set of al palindrome over {0,1}*. Draw a (10M)
transition diagram for the Turing machine of the above.

1 of 1
Code No: RT22055 R13 SET - 3
II B. Tech II Semester Regular Examinations, April/May - 2016
FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science and Engineering)
Time: 3 hours Max. Marks: 70
Note: 1. Question Paper consists of two parts (Part-A and Part-B)
2. Answer ALL the question in Part-A
3. Answer any THREE Questions from Part-B
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PART –A
1. a) Components of finite state automata. (4M)
b) Give three examples of context sensitive grammar which are not context-free. (3M)
c) Advantages and disadvantages of NDFA. (4M)
d) What is Two-way DFA? Give its advantages of DFA. (4M)
e) Show that the language L={ anbn/ n≥1} is unambiguous. (4M)
f) When do you say that a Turing machine accepts a string? (3M)
PART -B
2. a) Construct a finite state automata that recognizes all possible strings over the (8M)
alphabet {0,1} ending with two consecutive zeros.
b) Construct a finite state automata with ∈-transition for the regular expression (8M)
r=01*+10

3. a) Show that the union of two recursive languages is recursive and the union of two (8M)
recursive enumerable languages is also recursively enumerable.
b) Explain the properties of recursive and recursively enumerable language in detail (8M)
with an example.

4. a) Construct a DFA to accept the language L={w/w has both an even number of 0’s (8M)
and even number of 1’s}.
b) Explain the steps in the design of NFA with ∈- moves from NFA. (8M)

5. a) Construct a finite state automata equivalent to the regular expression (8M)


(0+1)*(00+11)(0+1)*
b) Explain the algorithm for optimization of DFA with suitable example. (8M)

6. a) Consider the CFG with the following production rules: (8M)


S  aB/ bA
A  bAA / aS/ a
B  aBB / bS/ b
Give the right most derivation and draw derivation tree for the string abbaab
b) Find a Greibach normal form grammar equivalent to the following CFG. (8M)
S  ASB/ AB
Aa
Bb

7. Design a Turing Machine which can multiply two positive integers. (16M)
1 of 1
Code No: RT22055 R13 SET - 4

II B. Tech II Semester Regular Examinations, April/May - 2016


FORMAL LANGUAGES AND AUTOMATA THEORY
(Computer Science and Engineering)
Time: 3 hours Max. Marks: 70
Note: 1. Question Paper consists of two parts (Part-A and Part-B)
2. Answer ALL the question in Part-A
3. Answer any THREE Questions from Part-B
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PART –A

1. a) Draw a diagram for finite automata which represents a bank. (4M)


b) What are context sensitive languages? Write one example. (3M)
c) Draw a NFA which accepting the set of all strings whose second last symbol is (4M)
1.
d) List the four components used to form a context free grammar. (4M)
e) Chomsky normal form Vs Griebach normal form. (4M)
f) Give examples of an undecidable problem. (3M)

PART –B

2. a) .Define the following terms, with an example for each: (8M)


i) String ii) Alphabet iii) Powerset iv) Language
b) Construct a finite state automata with ∈-transition for the regular expression (8M)
(ab+aba)*

3. a) Show that any non trivial property of the recursively enumerable language is (8M)
undecidable.
b) Define pumping lemma. How it is used in context free languages? (8M)

4. a) For the regular expression given below, obtain an NFA without ∈-moves. (8M)
(0+1)*(00+11)
b) Discuss about equivalence of NFA and DFA. (8M)

5. a) Prove that regular sets are closed under union and complementation. (8M)
b) Construct an NFA equivalent to the regular expression 10+(0+11)0*1 (8M)

6. a) Design a Moore machine that accepts all strings of 0’s and 1’s treated as binary (8M)
integer number return a remainder 1 when divided by 3.
b) Convert the following grammar into Chomsky Normal Form. (8M)
S  aB/ bA
A  bAA / aS/ a
B  aBB / bS/ b

7. Design A Turing Machine to recognize the language {1n2n3n/n≥1}. (16M)

1 of 1

You might also like