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

Printed Pages: 2

Subject Code: KCS-402 Roll No.:

B.Tech.
(SEM IV) EVEN SEMESTER THEORY EXAMINATION, 2021-22

THEORY OF AUTOMATA AND FORMAL LANGUAGE


Time: 3 Hrs Maximum Marks: 100

Note:
(i) Answer ALL questions. All questions carry equal marks.
(ii) Notations/ Symbols/ Abbreviations used have usual meaning.
(iii) Make suitable assumptions, wherever required.

Q1. Answer ALL parts. Marks


(a) (i) Define the language accepted by NFA and DFA. 5
(ii) What do you understand by ε-Closure?
(iii) Differentiate between Moore machine and Mealy machine
(iv) What is difference between “language accepted” and “language recognized” by any
abstract machine?
(v) Prove or disprove the following.
If Union of L1 and L2 is regular then L1 is regular or L2 is regular
(b) Determine whether following claims are true for all regular expression r and s. Justify your 5
answer.
(i) (r+s)* ≡ r*+s*
(ii) (rs)* ≡ r*s*
(c) Obtain a DFA which accepts the set of all those strings over Σ= {0,1} that begin with 00 5
and do not end with 11
OR
Obtain the regular expression for the following languages.
(i) The set of all strings w over Σ = {a, b} in which w has no pair of consecutive 0’s.
(ii) Set of all strings over Σ = {0, 1} that contains 1 either at 2nd position or 3rd position from
end.

(d) Design a deterministic finite automata which (DFA) with minimum number of states which 5
accepts all the strings over Σ = {0, 1, 2, 3}, which if treated as decimal number, sum of their
digits is divisible by 3.
OR
Construct a minimum state automata equivalent to following automata.

Q2. Answer ALL parts.


(a) Discuss the Chomsky classification of the languages. 10
(b) Prove or disprove that the given Language L is not regular. 10
L= {am bn | m ≠ n, where m and n are natural number}.

KCS-402 Page 1
OR
Obtain the regular expression for the following finite automata.

Q3. Answer ALL parts.


(a) Simplify the given CFG having S as start symbol by eliminating null productions, unit 10
productions and useless symbols.
S → aA | aBB A → aaA | ϵ B → bB |bbC C→B
What language does this grammar generate?
(b) Consider the given CFG G = (V,T,P,S) for algebraic expression. V= {S}, T= { a, b}, S is 10
start symbol. Productions P are as follows.
S → aSbS | aS | c
Show that grammar G is ambiguous and hence obtain equivalent unambiguous grammar.

OR
Convert the following grammar into Greibach Normal Form (GNF).
S → AB
A → BS | 0
B → SA | 1
Q4. Answer ALL parts.
(a) Construct a Deterministic Push Down Automata (PDA) which accepts the language L 10
defined as follows:
L={ a2mbncm | m, n are natural numbers}.
(b) (i) Write a context free grammar that generates the following language L. 4+6
L= {ambn+pcp| m, n, p are natural numbers}
(ii) If L1 and L2 are context free languages then L1 - L2 is also context free language. Prove
or disprove.
OR
(i) Give a formal definition of deterministic PDA. What do you understand by
Instantaneous Description (ID) of Pushdown automata?
(ii) Obtain the equivalent CFG that generates the same language L which is accepted by
the given PDA M= ({q0}, {a, b}, { a, b, Z0}, δ, q0, Z0, Φ ) by empty stack.

δ( q0, a, Z0) = (q0, aZ0 ) δ( q0, a, Z0) = (q0, aZ0 )


δ( q0, a, a) = (q0, aa ) δ( q0, b, b) = (q0, bb )
δ( q0, a, b) = (q0,  ) δ( q0, b, a) = (q0, )
δ( q0, , Z0) = (q0, )
.
Q5. Answer ALL parts.
(a) Design a Turing machine for anyone of the following. 10
(i) Turing machine that computes the function f given by f(n) = n2 ; n is natural
numbers.
(ii) Turing machine that recognizes the language L= { 0n1n2n | n is natural number}
(b) i) Prove that intersection of recursively enumerable is also recursively enumerable. 5+3+2
ii) Write notes on Universal Turing machine.
iii) Differentiate between NP-Hard and NP-Complete problems?

OR
i) Obtain solution, if it exists, of the PCP instance presented as two lists
A= (ab, a, bc, c) and B= (bc, ab, ca, a)
ii) What do you understand by undecidable problem? Explain.
iii) Discuss the importance of the question whether P = NP or P ≠ NP.

KCS-402 Page 2

You might also like