cs301-f - Ktu Qbank
cs301-f - Ktu Qbank
A Pages: 3
2 Differentiate between the transition function in DFA, NFA and ϵ-NFA (3)
3 Design a Moore machine to determine the residue of mod 2 of the input treated (3)
as a binary string.
4 Give a regular expression for the set of all strings not containing 101 as a (3)
substring
PART B
Answer any two full questions, each carries 9 marks.
5 a) Convert the following NFA to DFA and describe the language it accepts. (5)
(* +* + * +) and δ is given as:
0 1
P {P,Q} {P}
Q {R,S} {T}
R {P,R} {T}
S - -
T - -
b) Prove that “ A language L is accepted by some ϵ-NFA if and only if L is (4)
accepted by some NFA”
00000CS301121901
ϵ 1 2 3
q0 ᴓ { q0} { q1} { q2}
q1 { q0} { q1} { q2} ᴓ
b) Describe clearly the equivalent classes of the Canonical Myhill-Nerode relation (5)
for the language of binary strings with second-last symbol as 0.
PART C
Answer all questions, each carries3 marks.
8 State the closure properties of regular sets. (3)
9 Define context free grammar. Consider the following CFG (3)
| | |
Prove by induction on the string length that no string in L(G) has as
substring.
10 Design a PDA to accept the set of strings with twice as many 0’s as 1’s. (3)
11 List the decision problems related with type 3 Formalism. (3)
PART D
Answer any two full questions, each carries9 marks.
12 a) State pumping lemma for regular languages. Prove that the language (5)
{ | } is not regular.
b) Convert the following grammar into Chomsky normal form (4)
| | | |
00000CS301121901
13 a) Prove the equivalence of acceptance of a PDA by final state and empty stack. (6)
b) Define a deterministic PDA. How a DPDA differs from a non-deterministic (3)
PDA?
14 a) Let G be the grammar (4)
| | | | |
For the string find
i) leftmost derivation, ii) parse tree, and iii) Is the grammar ambiguous?
b) Design a PDA to accept the language * | * + +. (5)
PART E
Answer any four full questions, each carries10 marks.
15 a) Show that the language * | * + + is not a CFL. (5)
b) Design a TM to compute the 2’s complement of a binary string. (5)
16 a) State and prove pumping lemma for context free languages. Mention the (6)
application of pumping lemma.
b) Design a Turing machine to accept , (4)
* * +| +.
17 a) Compare context sensitive grammar and context free grammar. Can we design a (5)
PDA for context sensitive languages? Justify your answer.
b) Design a TM to find the sum of two numbers m and n. Assume that initially the (5)
tape contains m number of 0s followed by # followed by n number of 0s
18 a) Are there any languages which are not recursively enumerable, but accepted by (5)
a multi-tape Turing machine? Justify your answer.
b) Define formally Type 0, Type 1, Type 2 and Type 3 grammar. Show the (5)
corresponding automata for each class
19 a) List the closure properties of Recursive Languages (4)
b) Define a Universal Turing Machine (UTM). With the help of suitable arguments (6)
show the simulation of other Turing machines by a UTM.
20 a) Compare recursive and recursively enumerable languages. (3)
b) Show that the class of recursive languages is closed under complementation. (3)
c) Show that the class of recursively enumerable languages are not closed under (4)
complementation.
****