Gujarat Technological University
Gujarat Technological University
Gujarat Technological University
___________
Q.1 (a) Discuss Recursive definition. Also define the language L defined by the 03
following recursive definition over ∑ = {a, b}:
^ ∈ L;
For every x ∈ L, xa, bx, and abx are in L;
Nothing else is in L.
(b) Let relation R = {(a,b) : a + b = 10 and a, b ∈ N}. Decide whether R is an 04
equivalence relation or not. Justify your answer with proper reason.
(c) Using the principle of mathematical induction, for all n > 0, prove that, 07
𝑛 (𝑛 + 1) (4𝑛 − 1)
1 × 2 + 3 × 4 + 5 × 6 + . . . . . + (2n − 1) × 2n =
3
Q.2 (a) Write regular expressions for the following languages defined over ∑ = {0, 1}: 03
(i) The language of all the strings that do not end with 01.
(ii) The language of all the strings containing even number of 0’s and even
number of 1’s.
(b) Draw DFA for the following languages defined over ∑ = {a, b}: 04
(i) The language of all the strings with next-to-last symbol is a.
(ii) The language of all the strings containing substring bba.
(c) Convert the following NFA into its equivalent DFA using the subset 07
construction.
Q.3 (a) Prove that the context-free languages are closed under union. 03
(b) For the following CFG, find out two left most derivations for the string “aaabb” 04
and also draw the corresponding parse trees.
S → XY
X → XX | a
Y → YY | b
(c) Define CNF. Also convert the following CFG into its equivalent CNF. 07
S → aX | Y | bab
X→^|Y
Y → bb | bXb
Q.4 (a) What language over {a, b}* does the CFG with productions 03
S → aT | bT
T → aS | bS | ^
generate? Prove your answer.
1
(b) Let M1 and M2 be the FAs pictured in Fig. (i) and Fig. (ii) accept the languages 04
L1 and L2, respectively.
Fig. (i)
Fig. (ii)
*************