10CS56 Dec14
10CS56 Dec14
PART-A
1 a. Define the following with proper examples:
i) Alphabet ii) Powers of an alphabet. (03 Marks)
b. Design the DF A's for the following languages:
i) Set of all strings with at least one 'a' and exactly two 'b's on I = {a, b}.
ii) Set ofal! strings such that number of 1's is even and the number ofO's is a multiple of
3 on }' = {O, I}. (08 Marks)
'c. Desil1n an NFA with no more than 5 states for the following language:
i I I
L = abab" n ~ 0 }U {aba n n ~ O} (03 Marks)
d. Prove that if D = (Qo, I, 00, {qo}, Fo) is the DFA constructed from FA
= (Q ., L, ON, qo, F .) by the subset construction, then L(D) = L( ). (06 Marks)
b. Define regular expression and also write the regular expressions for the following languages:
i) L= {WE {a, b}« Iw has exactly one pair of consecutive a's}.
ii) Set of all strings not ending in substring 'ab' over I = {a, b}. (06 Marks)
c. Prove that if L = L(A) for some DF A A, then there is a regular expression R such -that
L = L(R). (06 Marks)
d. Obtain the regular expression for the following DFA using state elimination technique:
~03Marks)
I i
<U
-0 j
z•.. Fig.Q.2(d) . I !
~
t
o
c,
3 a. State and prove pumping lemma for regular languages. ' (07 Marks)
E
b. Let I = {a, b}. Show that the language L = {w E '2:°1 na (w) < nb(w) } is not regular.
(05 Marks)
I of3
I ,
'~
lOCS56
c. Consider the OF A given by the transition table:
8 a b
-)qo q, q2
q, q, q3
q2 q, q2
q3 q, q4
=q, q, q2
4 a. Defme a Context-Free Grammar (CFG) and also obtain the CFG's for the following
languages:
i) L\ = {a"wwRb"lw E {O,lf and n ~ 2}
ii) L2={akbmc lm+n=k
ll
andm,n~l}
iii) L3 = {w E {afllwlmod3:t:lwlmod2}. (10 Marks)
PART-B
5 a. Design a PDA for the following language: L = {wwRlw E {a,b} +}. Also, draw
, the
transition diagram for the constructed PDA. Write the instantaneous description (10) for the
string 'abbbba'. (08 Marks)
b. Convert the following CFG to a PDA that accepts the same language by empty stack:
E -) E + E I E *EI (E) 11
1-) IalIbl!01 III a I b 05 Marks)
c. Defme a deterministic PDA (OPDA). Also, design a DPDA along with transition diagram
I
for the following language: L = {anb2n n ~ 0 }. (07 Marks)
B -) Clb
C -) COEIE
D-)AIBlab
20f3
lOCS56
i) Eliminate e-productions.
ii) Eliminate any unit productions in the resulting grammar.
iii) Eliminate any useless symbols in the resulting grammar. (08 Marks)
b. Define Chomsky onnal Form (C F). Also, convert the following CFG to CNF:
S -7 ABla
A aab
-7
B-7 Ac . (06 Marks)
c.. Show that the language L = {XE {O, 1)*1 Ixl is a perfect square} is not context-free.
(06 Marks)
7 a. Defme a Turing machine. Also, design a Turing machine to accept the set of all palindromes
over {a, l}*. Write the transition diagram for the constructed Turing machine and write the
sequence ofID's for the input string' 100 I'. (12 Marks)
b. Explain multitape Turing machine and non-deterministic Turing machines with neat block I
*****
I I I
I I
30f3