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

Printed Pages: 2

Subject Code: KCS-402 Roll No.:

B.Tech.
(SEM IV) EVEN SEMESTER THEORY EXAMINATION, 2022-23

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) If L1 and L2 are non regular then L1 ꓴ L2 is non regular. Prove or disprove the statement. 5

(b) Discuss the difference between Moore Machine and Mealy Machine with the help of 5
suitable examples.

(c) Obtain the regular expression for the following languages. 5


(i) The set of all strings of 0’s and 1’s in which every 0 is followed by 11.
(ii) The set of all strings of 0’s and 1’s in which the number of 0’s is even

OR
i. What do you understand by concept of nondeterminism in the context of
abstract machines?
ii. Simplify the regular expression (r1+ r2+ r1 r2+ r2 r1)*

(d) Obtain a DFA with minimum states which accepts the set of all those strings over Σ= {0,1} 5
which do not contain 0100.
OR
Construct a minimum state automata equivalent to following automata.

Q2. Answer ALL parts.


(a) Obtain the FA without epsilon transition corresponding to the following regular expression 10
00 (0* + 1*)* 11
Thereafter obtain the finite automata that accepts the complement of the language
accepted by that automata.

KCS-402 Page 1
(b) Consider the given Language L. 10
L= {am | m is non prime natural number }
Prove whether L is regular or not.

OR
Obtain the regular expression for the following finite automata.

Q3. Answer ALL parts.


(a) What do you understand by useless symbol in a CFG? For the given CFG, find an 10
equivalent CFG with no useless symbols.
S → AB | AC
A → aAb | bAa| a
B → bbA | aaB| AB
C → abCa | aDb
D → bD| aC

(b) Consider the given CFG G = (V,T,P,S) for algebraic expression. V= {S}, T= {$, *, %, a}, 10
S is start symbol. Productions P are as follows.
S→ S$S| S%S| S*S | a
$, *, % are binary operators in increasing order of precedence. $ and % are right
associative while * is left associative. a is identifier.
Show that grammar G is ambiguous and hence obtain equivalent unambiguous grammar
free from left recursion.
OR

Convert the following grammar into Greibach Normal Form (GNF).


S → AA | a
A → SS | b

Q4. Answer ALL parts.


(a) Construct a Deterministic Push Down Automata (PDA) which accepts the language L 10
defined as follows:
L={ w ԑ (0+1)* | number of 0’s and number of 1’s are equal}

(b) (i) Write a context free grammar for the language L defined as follows. 10
L={ambncp | m = n or n=p; m, n, p are natural numbers}.

(ii) Prove that intersection of two Context Free Languages may not be Context Free
Language.

OR
(i) Obtain the equivalent PDA that accepts the same language L which is generated by the
following context free grammar.
S → aSb
A → bAa | S | ԑ
(ii) Give an example of the language which is accepted by some NPDA but not by any
DPDA.

KCS-402 Page 2
(iii) What do you understand by following statement in context of PDA? Explain.

If (q0, w, ẞ) Ͱ∗ (q, ԑ, ԑ) then (q0, w, ẞY) Ͱ∗ (q, ԑ, Y)


where ẞ and Y are strings of stack symbols
.
Q5. Answer ALL parts.
(a) Design any one of the following Turing Machines. 10
(i) Turing machine that computes the function f given by f(n) = 2n ; n is natural
numbers.
(ii) Turing machine that takes a binary string as input and gives 2’s complement of it
as output.
(b) Give one example, if it exists, for each of the following languages. 10
i) A language that is recursively enumerable but not recursive.
ii) A decidable language whose complement is not decidable
iii) A PCP that has no solution.

OR
Differentiate between the following:
i) Recursively enumerable language and recursive language
ii) Post Correspondence Problem (PCP) and Modified Post Correspondence Problem
(MPCP)
iii) P and NP Class of problem

KCS-402 Page 3

You might also like