Instructions: Separate Answer-Books
Instructions: Separate Answer-Books
[4363]-255
T. E.(Comp. Engineering.)Examination - 2013
THEORY OF COMPUTATION
(2008 Pattern)
[Total No. of Questions:] [Total No. of Printed Pages :5]
[Time : 3 Hours] [Max. Marks : 100]
Instructions :
(1) Answers to the two sections should be written in
separate answer-books.
(2) Assume suitable data, if necessary.
SECTION-I
Q1 a) Define the following with examples: [8]
Kleen closure
An alphabet
Regular expression
Formal language
b) Design a Moore machine that will read sequences made up of the [8]
letters A, E, I, O, U and will give as output the same sequence except
in case where I directly follows an E, I will be changed to U.
OR
Q2 a) Design a finite automata that reads strings made up of letters in the [8]
Word „CHARIOT‟ and recognize those strings that contain the word
„CAT‟ as a substring.
b) Construct DFA equivalent to NFA [8]
0 1
→P p,q p
q r r
r s -
s s s
Q3 a) Prove that the FA whose transition graph is as shown below accepts [8]
The set of all strings over the alphabet {0,1} with an equal number
Of 0‟s and 1‟s, such that each prefix has atmost one more 0 than 1‟s
And atmost one more 1 than 0‟s.
b) Show that L={𝑎𝑝 /𝑝 is prime} is not regular. Make use of pumping [6]
lemma and explain the steps in detail.
c) Describe in English language accepted by R.E. ⟹ (0+1)* 0 [2]
OR
Q4 a) State and explain in detail the closure properties of regular sets [8]
b) Explain the application of regular expressions in lexical analysis phase
of compiler [6]
c) State the pumping lemma for regular sets [2]
Q5 a) Convert the following CFG into CNF(Chomsky Normal Form) [6]
S⟶ABA
A⟶aA|∈
B⟶bB|∈
b) Write a CFG for generating identifiers in higher-level languages such [4]
as „C‟. identifiers can be defined by the regular expression(letter). (letter
1 digit)*
c) Obtain a DFA accepting the regular language defined by the following [8]
right-linear grammar
S⟶OA|1B
A⟶OC|1A|0
B⟶ 1B|1A|1
C⟶0|0A
OR
Q6 a) Convert the following CFG into GNF(Greibach Normal Form) [8]
S⟶AB
A⟶BS|b
B⟶SA|a
b) Construct a grammar G to represent a language L which is a set of [4]
all palindromes over {a,b}
c) Consider the grammar G given by S⟶S+S|S*S|a|b. find the [6]
derivation tree for a*b+a*b. is the grammar ambiguous
SECTION-II
Q7 a) Design a PDA to check whether the given expression is a valid [6]
Postfix expression.
b) Compare deterministic PDA with non-deterministic PDA [4]
c) Design a PDA for the following CFG G [6]
G= { S ⟶ aAA
A⟶bS
A⟶aS
S⟶a }
OR
Q8 a) The following PDA accepts a language: L= 𝑎𝑛 𝑏 𝑚 𝑎𝑛 |𝑚, 𝑛 ≥ 1 [12]
Construct equivalent CFG for L such that L(G)=N(A)
A=( 𝑞0 𝑞1 , 𝑎, 𝑏 , 𝑎, 𝑧0 , 𝛿, 𝑞0 , 𝑧0 , 𝜙)
Where 𝛿 is given as follows:
𝛿(𝑞0 , 𝑞, 𝑧0 ) = {(𝑞0 , 𝑞, 𝑧0 )}
𝛿(𝑞0 , 𝑞, 𝑞) = {(𝑞0 , 𝑎𝑎)}
𝛿(𝑞0 , 𝑏, 𝑎) = {(𝑞1 , 𝑎)}
𝛿(𝑞1 , 𝑎, 𝑎) = {(𝑞0 , €)}
𝛿(𝑞1 , 𝑏, 𝑎) = { 𝛿(𝑞1 , 𝑎)}
𝛿(𝑞1 , €, 𝑧0 ) = {(𝑞0 , €)}
b) Compare PDA with FA (finite automata) [4]
Q9 a) Design a turning machine which checks for the language L= 𝑎𝑛 𝑏 𝑛 [8]
b) Define Turing machine [2]
c) Design a TM to subtract two unary numbers, the original numbers [8]
need not be retained
OR
Q10 a) Design a turing machine to compute 2‟s complement of a given [6]
Binary number.
b) Write short note on universal turing machine along with example [6]
c) Compare NFA, DFA, NPDA, DPDA, turing machines with [6]
reference to type of the grammar
Q11 a) Show that if 𝐿1 and 𝐿2 are recursive languages, then 𝐿1 ∪ 𝐿2 and [8]
𝐿1 ∩ 𝐿2 are also recursive
b) Explain in detail “Post‟s Correspondence Problem” with the help [8]
of example
OR
Q12 a) Describe in detail Chomsky Hierarchy and context-sensitive languages. [8]
b) Explain in detail the “Halting problem” [6]
c) Define undecidability [2]