16CS517-Formal Languages and Automata Theory
16CS517-Formal Languages and Automata Theory
16CS517-Formal Languages and Automata Theory
Subject with Code : FLAT(16CS517) Course & Branch: B.Tech – CSE & CSIT
Year & Sem: III-B.Tech & I-Sem Regulation: R16
UNIT I
Introduction To Finite Automata
1. a) Consider the below finite automata and check the strings are accepted or not
FLAT Page 1
QUESTION BANK 2019
4. Convert the following Mealy machine into its equivalent Moore machine. [L2,10M]
A C 0 B 0
B A 1 D 0
C B 1 A 1
D D 1 C 0
FLAT Page 2
QUESTION BANK 2019
9. a) Define relations on set and explain its property with an example [L1,3M]
b) Define NFA and DFA. Construct DFA for the given NFA [L2,7M]
FLAT Page 3
QUESTION BANK 2019
UNIT II
Regular Languages
FLAT Page 4
QUESTION BANK 2019
9. a)Write the process of equivalence two FA’s? Find whether the equivalence two FA’s or not.[L3,7M]
FLAT Page 5
QUESTION BANK 2019
UNIT III
Context Free Grammars and Languages
1. Write the procedure and Eliminate left recursion from the following Grammar [L2,10]
EE+T/T
TT*F/F
F(E)/id
2. a) Explain about derivation and parse trees? Construct the string 0100110 from the Leftmost
and Rightmost derivation.
S0S/1AA
A0/1A/0B
B1/0BB [L2,5M]
b) Find the parse tree for generating the string 11001010 from the given grammar.[L2,5M]
S1B/0A
A1/1S/0AA
B0/0S/1BB
3. a) Define Ambiguous grammar. [L2,4M]
b) Remove Left recursion from the grammar SSab/T
TTcd/F
FFa/G [L2, 6M]
4. a) Explain Left recursion and Left factoring. [L3,4M]
b) Perform left factor from the grammar AabB/aB/cdg/cdeB/cdfB [L3, 6M]
5. Simplify the following context free grammar. (Here, Ʌ stands for epsilon (ϵ)). [L4,10M]
STU|V
TaTb|Ʌ
UcU| Ʌ
VaVc|W
WbW| Ʌ
6. Convert the following grammar into Greibach normal form. [L4,10M]
SAA/a
ASS/b
7. a) Write the process for Convert the grammar into CNF? [L3,4M]
b) Convert the following grammar into CNF. [L3, 6M]
SbA/aB AbAA/aS/a BaBB/bS/a.
8. a) What is linear grammar? Explain in detail with example. [L3,4M]
b) Explain the closure properties of context free languages. [L3, 6M]
9. a)Remove the unit production from the grammar
SAB,AE,BC,CD,Db,Ea [L3,4M]
b) Remove ϵ productions from the grammar
SABaC, ABC, Bb/ ϵ, CD/ ϵ, Dd [L3, 6M]
10. a) Write about Decision problems for CFLs with example? [L3,5M]
b) What is the differentiate between CFG and Regular Language? [L3, 4M]
FLAT Page 6
QUESTION BANK 2019
UNIT IV
Pushdown Automata
1. a) Construct a PDA which recognizes all strings that contain equal number
of 0’s and 1’s. [L2, 6M]
b) A PDA is more powerful than a finite automaton. Justify this statement. [L2, 4M]
2. Construct PDA from the following Grammar.
S aB
B bA/b
A aB [L2, 10M]
3. Construct PDA from the following Grammar
S0BB
B0S/1S/0 [L2, 10M]
Show an ID for the string 010000 is generated for PDA?
4. Construct a CFG equivalent to the following PDA. [L2,10M]
PDA={(p, q), (0, 1), δ, p, q, (Z, X)}, where p is initial state, q is final state.
δ is defined as δ(p,0,Z)=(p,XZ), δ(p,0,X)=(p,XX), δ(p,1,X)=(q,ϵ), δ(p,1,X)=(p,ϵ), δ(p,ϵ,Z)=(p,ϵ).
[L3,10M]
5. a) Construct an equivalent PDA for the following CFG [L3,7M]
SaAB | bBA
AbS | a
B aS | b
b) Explain the informal introduction and formal definition of PDA. [L2, 3M]
6. a) Define Instantaneous description (ID) in PDA. [L2,5M]
b) Explain about the graphical notation of PDA. [L2, 5M]
7. a) Write the process for convert PDA into an equivalent CFG. [L4,4M]
b) Convert the following PDA into an equivalent CFG. [L4, 6M]
δ (q0,a0,z0)(q1,z1z0)
δ(q0,b,z0)(q1,z2z0)
δ(q1,a,z1)(q1, z1z1)
δ(q1,b,z1)(q1, λ)
δ(q1,b,z2)(q1,z2z2)
δ(q1,a,z2)(q1, λ)
δ(q1, λ,z2)(q1, λ) // accepted by the empty stack.
8. a) Define push down automata? Explain acceptance of PDA with empty stack. [L2,5M]
b) Define Instantaneous description (ID) in PDA. [L2, 5M]
9. a) Explain about the graphical notation of PDA. [L2,4M]
b) Construct an equivalent PDA for the following CFG. [L3, 6M]
SaAB | bBA
AbS|a
BaS | b.
10. Explain Deterministic Push down Automata with example? [L2, 12M]
FLAT Page 7
QUESTION BANK 2019
UNIT - V
Turing machines & Undecidability
FLAT Page 8