FLAT

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

B.

Tech III Year I Semester Examinations, April-2021


(Computer Science and Engineering)
FORMAL LANGUAGES AND AUTOMATA THEORY
MODEL QUESTION PAPER

UNIT-I

1.a) Convert the following NFA with € - moves to DFA shown in figure 1.

b) Minimize the following DFA shown in figure 2.

2.a) Design DFA for the language all strings over {0,1} which are ending with 00.
b) Minimize the following DFA shown in figure 2.

Figure: 2

3.a) Check whether the following two Finite Automaton’s are equivalent or not?
Finite Automaton (FA) 1 (figure 3):

Figure: 3
Finite Automaton (FA) 2(figure 4):

Figure: 4
b) Convert the following NFA with € moves to DFA in figure 5.

Figure: 5

4.Design Finite Automaton which accepts set of all strings not Containing 101 as substring.
5.Construct Minimum state Automata for the following DFA?
* denotes final state
δ 0 1
Q1 q2 q6
q2 q1 q3
*q3 q2 q4
q4 q4 q2
q5 q4 q5
*q6 q5 q4

b) Differentiate between NFA and DFA.


6.Design DFA for the following over {a,b}.
i) All strings containing not more than three a’s.
ii) All strings that has at least two occurrences of b between any two occurrences of a.
b) Construct a DFA accepting the set of all strings ending with 00?

7.a) Convert the Moore machine to determine residue mod 3 into Mealy machine.
b) Construct the minimum state automata for the following.
0 1
→A B C
B B C
C B C
D B E
E B C
8.a) Convert the following NFA with ε to equivalent DFA:
a b ε
→P Φ P Q
Q Q Φ R
R Q P Φ

b) Design NFA Accepting string with a’s and b’s such that string containing two
consecutive a’s or two consecutive b’s.
9. a) Construct DFA for the following: L={w | w has both an even number of 0’s and even
number of 1’s }.
b) Minimize the following DFA using equivalence theorem.

10.a) Construct the equivalent DFA for the NFA which accepts the language (a/b)*abb.
b) Design a Moore Machine to determine the residue mod 5 for each binary string treated as
integer.
UNIT-II
1.a) Convert the following Finite Automata to it’s equivalent Regular Expression as
shown in figure 5.

Figure: 5
b)Construct Finite Automata for the regular expression 0*1*(00)*1.

2.a) Construct Finite Automata for ((0+1)*00)*110.


b) Find the right linear grammar for the following regular Expression 0*110*.
3. a) Define Regular Expression? Explain about the Properties of Regular Expressions.
b) Construct a DFA for the Regular Language consisting of any number of a’s and b’s.
4.a) Construct a DFA for the Regular expression (0+1) * (00+11) (0+1)* .
b) Explain about the identity rules of Regular Expressions.
5. Construct an NFA for the following Regular expression:
a) 01[((10)*+111)*+0]*1
b) ((01+10)*00)*
6.a) Find the regular grammar for the following Finite Automate shown in figure 6.

Figure: 6
b) Construct FA for the following regular expressions (0+1)*(1+00)(0+1)*.

7. a)Prove that the following language {anbn | n ≥ 1} is not a regular.

b)Write a R.E. for the following DFA:


8.a) Prove or disprove the following for regular expressions r, s, and t.
i) (r + s)t = rt + st ii) (rs + r)*r = r(sr + r)*
b)Write a detail note on the closure properties of regular sets.

9. a)Construct Regular grammar for the given Finite Automata.(a+b)*ab*.

b)Construct the right linear grammar for the language (0+1)*00(0+1)*.


10. a)Define Regular Expression? Explain about the properties of Regular Expressions.
b)Construct a DFA for the Regular expression (0+1)*(00+11) (0+1)*.

11.a) For the following grammar give the leftmost and rightmost derivation for the
string ‘00101’.
S → A1B
A → 0A / ε
B → 0B / 1B / ε

b.) Construct an NFA for the following Regular expression:


i. 01[((10)*+111)*+0]*1
ii. ((01+10)*00)*
12.a) Find the regular grammar for the following Finite Automate shown in figure 6.

Figure: 6
b) Construct FA for the following regular expressions (0+1)*(1+00)(0+1)*.

13. a) Design a FA for the following languages a)  0*1* 


*

b) (0+1)* 111*
c) (0* 11* + 101)
UNIT-3
1.a) Design Push Down Automata for the language L={wcwR | w Є (0+1)*}
b) Define Ambiguous Grammar. Check whether the grammar.
SaAB, AbC/cd, Ccd, Bc/d Is Ambiguous or not?
2. a) Construct a PDA for the following grammar SAA/a, ASA/b.
b) Show that for every PDA there exists a CFG such that L(G)=N(P).
3. a) Convert the grammar S0AA, A 0S/1S/0 to a PDA that Accepts the same Language by Empty
Stack.
b) Design Push down Automata for the language L = {an b2n | n≥1}.
4.a) For the following grammar give the leftmost and rightmost derivation for the
string ‘00101’.
S → A1B
A → 0A / ε
B → 0B / 1B / ε
b) Construct the right linear grammar for the language (0+1)*00(0+1)*.
5. a)Construct CFG for the PDAM = ({q0,q1}, {0,1}, {R,Z0}, δ, q0, Z0, Φ) and δ is given
by
δ(q0,1,Z0)=(q0,RZ0)
δ(q0,1,R)=(q0,RR)
δ(q0,0,R)=(q1,R)
δ(q1,0, Z0)=(q0, Z0)
δ(q0,ε, Z0)=(q0,ε)
δ(q1,1,R)=(q1,ε)
b) Obtain a CFG to generate unequal number of a’s and b’s.

6.a) Construct a grammar in CNF of the language L={ an bm an | n≥0, m≥ 1}.


b) Prove the following grammar is ambiguous: S → aS | aSbS | ε.
7.a) Construct the PDA to the following grammar:
S→AB
A→BS/b
B→SA/a
b) List out the properties of PDA.
8.a) For the following grammar give the leftmost and rightmost derivation for the string ‘00101’.
S → A1B
A → 0A / ε
B → 0B / 1B / ε
b) Give the closure properties of deterministic context free languages.
9. a) Minimize the following Context Free Grammar G=({S,A,B,C}, {a,b,c,d},P,S), where
P is given as follows
S→AC | SB
A→ bASC | a
B→ aSB | bbB
C→ Bc | ad
b) Design PDA for the language L={a2nbnc4/n≥1}.
10. a) Derive left and right most derivations for the input string a=b*c+d/e for the given
Grammar.
EE+E|E-E|E*E
EE/E
E(E)|id
b) Explain the followings with examples.
i) Sentential Forms
ii)Deterministic Pushdown Automata.
UNIT-4
1 a) Convert the following Context Free Grammar (CFG) to Chomskey Normal Form
(CNF)
S→AaB | aaB
A→€
B→bbA | €
b) Convert the following grammar to Chomsky Normal Form
SaSa | bSb | a| b| aa | bb

2.a) Construct the Turing machine for the language L={ anb2n| n>=1}.
b) Explain about various types of Turing Machine.

3.a) Construct a Turing Machine that will accept the Language consists of all palindromes of
0’s and 1’s?
b) Design Turing Machine for the Language L={an bn cn/n≥1}.
4.a) Obtain GNF for SAB, ABS/b , BSA/a.
b) Design a Turing Machine for L={0n1m0n1m/m,n>=1}.
5.a) Convert the following grammar to Chomsky Normal Form
S ABA
A aA | Є
B bB | Є
and simplify the grammar
b) Write and explain closure properties of Context Free Languages.
6.a) State the Pumping Lemma for Context Free Languages.
b)Design Turing Machine for the Language L={ an bn cn/n≥1 }
7. a)Design Turing Machine to compute the function n!
b)Design TM for performing proper subtraction of two numbers.

8.a)Convert the following grammar to Greibach Normal Form


S→ABA | AB | BA | AA | B
A→aA | a
B→bB | b
b) Convert the following Context Free Grammar into Chomsky Normal Form
S→aaaaS | aaaa
9.a) Reduce the following grammar such that there are no UNIT productions
S → AA
A → B | BB
B → abB | b | bb
b) Design a TM to recognize the language L= {0n1n0n | n ≥ 1}.

10.a) Design TM which will recognize strings containing equal number of a's and b's.
b)Design a TM to accept the language L= {w c wR | w ε (a+b)*}.

11.Design a TM to recognize all strings consisting of odd number of 1's.


UNIT-5
1.a) Write properties of recursively enumerable languages.

b) What do you mean by Halting Problem of Turing Machine?

2.a)Explain about the Decidability and Undecidability Problems.


b) Give an overview of recursively enumerable language.
3.a) List the Closure properties of recursive Languages.
b)what are the types of TM’s explain in brief.

4.a) What are undecidable problems? Give example.


b) Briefly write about Universal Turning Machine (UTM).

5.a) Discuss about turing Reducibility.


b) Write aboutPost Correspondence Problem.
6. a)Let ἐ ={0,1} and A,B be the list of 3 strings each. Verify below PCP has a solution or not?

List A List B
1 wi xi
1 00 0
2 001 11
3 1000 011
b) Define post`s correspondence problem and show that it is undecidable.
7.a) Explain about post correspondence problem in detail.
b) Explain counter machine machine in detail.
8. a) What is post correspondence problem? Verify whether the following PCP has solution or not?
A={ba,ab,a,baa,b}, B={ bab,baa,ba,a,aba }.
b)obtain the solution for the following system of post correspondence problem. A={100,0,1},
B={1,100,00}.
9.Find whether the post correspondence problem p={(10,101),(011,11),(101,011)}has a match.
Give the solution .
10.Give three examples of recursive Languages.

You might also like