You are on page 1of 10

Code No: RR310504 Set No.

1
III B.Tech I Semester Supplimentary Examinations, February 2008
THEORY OF COMPUTATION
( Common to Computer Science & Engineering and Computer Science &
Systems Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. For the following state transition table draw the state transition diagram. Find its
equivalent machine. For the string abbaaab test whether both give same result or
not. q0 is the initial state and q3 is the final state. [16]
q/Σ 0 1
q0 q1 q2
q1 q1 q 1 q3
q2 φ φ
q3 q0 q3 q3

2. (a) Compare three Finite automata critically.


(b) Construct DFA equivalent to the following Finite automation. Figure 2
[8+8]

Figure 2
3. (a) Construct a regular expression representing the following sets The set of all
strings over {a, b} in which there are atleast two occurrences of b between any
two occurrences of a.
(b) Describe whether L = {a2n |n ≥ 1} is regular. State and explain the theorem
used. [8+8]

4. (a) Obtain the regular grammar to accept the strings containing even number of
zeroes.
(b) Give the CFG to generating the following sets
The set of palindromes over alphabet {a, b} [8+8]

5. Construct a context free grammar which accepts N(A) where A is


({q0 , q1 , q2 }, {a, b, c}, {a, b, z0 }, δ , q0 , z0 , q2 )
where δ is given by
δ (q0 , a, z0 ) = (q0 , az 0 )
δ (q0 , b, z0 ) = (q0 , bz 0 )

1 of 2
Code No: RR310504 Set No. 1
δ (q0 , a, a) = (q0 , aa)
δ (q0 , b, a) = (q0 , ba)
δ (q0 , a, b) = (q0 , ab)
δ (q0 , b, b) = (q0 , bb)
δ (q0 , c, z0 ) = (q1 , z0 )
δ (q0 , c, a) = (q1 , a)
δ (q0 , c, b) = (q1 , b)
δ (q1 , a, a) = (q1 , ∈)
δ (q1 , b, b) = (q1 , ∈)
δ (q1,∈ , z0 ) = (q2 , z0 ) [16]

6. (a) Give formal definition of Turing Machine and explain the concept behind
saying “Turing Machine is more powerful than the digital computer”.
(b) Design Turing Machines for the following:
i. To compliment a given binary number.
ii. To compute f(x,y) = x+y for x and y positive integers represented in
Unary. [4+12]

7. (a) Discuss different languages and their corresponding machines.


(b) Write the design procedure of shift reduce parser by taking a suitable example.
[8+8]

8. Write short notes on any three of the following.

(a) NP hard problems


(b) Reducability
(c) PCP
(d) UTM. [16]

⋆⋆⋆⋆⋆

2 of 2
Code No: RR310504 Set No. 2
III B.Tech I Semester Supplimentary Examinations, February 2008
THEORY OF COMPUTATION
( Common to Computer Science & Engineering and Computer Science &
Systems Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) Differentiate NFA and DFA with respected to transition and acceptance.
(b) Draw DFA which accepts even number of a‘s over the alphabet {a, b}
(c) Construct DFA equivalent to the following Finite state machine. Figure 1
[2+6+8]

Figure 1
2. (a) Explain the procedure to convert NFA- ∈ to ordinary NFA, and apply the
same for the following figure 2a.

Figure 2a
(b) Design Moore and Mealy machines which converts a ternary number into
Residue Modulo 5. [8+8]

3. (a) Construct Finite automaton to accept the regular expression (0 + 1)∗ (00+11)
(0 + 1)∗ .
(b) Find the regular expression accepted by following deterministic Finite automa-
ton. Figure 3 [8+8]

1 of 3
Code No: RR310504 Set No. 2

Figure 3
4. (a) Construct a regular grammar corresponding to the state Figure 4a.

Figure 4a
(b) Show a derivation tree for the string aabbbb with the grammar S → AB/ ∈
A → aB, b → Sb [8+8]
5. (a) Convert the following to GNF
E → E + T/T
T → T * F/F
F → (E)/a
(b) Construct PDA generating all odd palindromes over string {a, b, c}. [8+8]
6. (a) Give formal definition of Turing Machine and explain the concept behind
saying “Turing Machine is more powerful than the digital computer”.
(b) Design Turing Machines for the following:
i. To compliment a given binary number.
ii. To compute f(x,y) = x+y for x and y positive integers represented in
Unary. [4+12]
7. Write short notes on:
(a) DCFL and DPDA
(b) LR(k) grammar
(c) C.S. languages. [6+6+4]
8. (a) Is concept of universal gates like Nor and Nand and the universal Turing
machine same. Explain the UTM in detail.
(b) What is modified version PCP? Show or explain that if the PCP is decidable
then modified PCP is also decidable. [8+8]

2 of 3
Code No: RR310504 Set No. 2
⋆⋆⋆⋆⋆

3 of 3
Code No: RR310504 Set No. 3
III B.Tech I Semester Supplimentary Examinations, February 2008
THEORY OF COMPUTATION
( Common to Computer Science & Engineering and Computer Science &
Systems Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) Differentiate NFA and DFA with respected to transition and acceptance.
(b) Draw DFA which accepts even number of a‘s over the alphabet {a, b}
(c) Construct DFA equivalent to the following Finite state machine. Figure 1
[2+6+8]

Figure 1
2. (a) Construct the Moore machine for Figure 2a Melay machine.

Figure 2a
(b) Minimize the Finite automation Figure 2b below and show both given and the
reduced one are equivalent. [6+10]

1 of 3
Code No: RR310504 Set No. 3

Figure 2b
3. (a) Construction a DFA for the regular expression r = (a+b)* a bb and optimize
the states.
(b) Show that L = {ap /p is prime} is not regular. [8+8]

4. (a) Construct left linear and right linear grammar for the regular expression.
0*(1(0+1))*
(b) Give the CFG to generating the following sets
The set of all strings over alphabet {a, b} with exactly twice as many a’s as
b’s. [8+8]

5. Construct a context free grammar which accepts N(A) where A is


({q0 , q1 , q2 }, {a, b, c}, {a, b, z0 }, δ , q0 , z0 , q2 )
where δ is given by
δ (q0 , a, z0 ) = (q0 , az 0 )
δ (q0 , b, z0 ) = (q0 , bz 0 )
δ (q0 , a, a) = (q0 , aa)
δ (q0 , b, a) = (q0 , ba)
δ (q0 , a, b) = (q0 , ab)
δ (q0 , b, b) = (q0 , bb)
δ (q0 , c, z0 ) = (q1 , z0 )
δ (q0 , c, a) = (q1 , a)
δ (q0 , c, b) = (q1 , b)
δ (q1 , a, a) = (q1 , ∈)
δ (q1 , b, b) = (q1 , ∈)
δ (q1,∈ , z0 ) = (q2 , z0 ) [16]

6. (a) What is delta of a Turing Machine, explain functions involved in a move of


Turing Machines in detail.
(b) Design Turing Machine to accept even palindromes derived from the input {a,
b}. Give its Transition table and diagram also. [6+10]

7. (a) Discuss the Chomsky Hierarchy of languages.

2 of 3
Code No: RR310504 Set No. 3
(b) For the grammar shown below construct the sets of LR(0) items.
S′ → S $
[6+10]
S → aS b|ab

8. (a) What is decidability? Explain any two undecidable problems.


(b) Show that the following post correspondence problem has a solution and give
the solution. [8+8]
List A List B
i wi xi
1 11 111
2 100 001
3 111 11

⋆⋆⋆⋆⋆

3 of 3
Code No: RR310504 Set No. 4
III B.Tech I Semester Supplimentary Examinations, February 2008
THEORY OF COMPUTATION
( Common to Computer Science & Engineering and Computer Science &
Systems Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. For the NFA given by following state transition diagram Figure 1

(a) check whether the string abbabba is accepted or not


(b) Give at least two transition paths.
(c) Find equivalent DFA. Check for same result of bit (a). [5+3+8]

Figure 1
2. (a) Explain the procedure to convert NFA- ∈ to ordinary NFA, and apply the
same for the following figure 2a.

Figure 2a
(b) Design Moore and Mealy machines which converts a ternary number into
Residue Modulo 5. [8+8]

3. (a) Construction a DFA for the regular expression r = (a+b)* a bb and optimize
the states.
(b) Show that L = {ap /p is prime} is not regular. [8+8]

4. (a) Construct a regular grammar G generating the regular set represented by


a*b(a+b)*.
(b) Give the CFG to generating the following sets
The set of all strings of balanced parenthesis [8+8]

1 of 2
Code No: RR310504 Set No. 4
5. (a) Design a PDA to accept the following CFG
S → AA/a
A → SA/b.
(b) Explain properties of C.F. languages. [8+8]

6. (a) Give formal definition of Turing Machine and explain the concept behind
saying “Turing Machine is more powerful than the digital computer”.
(b) Design Turing Machines for the following:
i. To compliment a given binary number.
ii. To compute f(x,y) = x+y for x and y positive integers represented in
Unary. [4+12]

7. (a) Discuss the Chomsky Hierarchy of languages.


(b) For the grammar shown below construct the sets of LR(0) items.
S′ → S $
[6+10]
S → aS b|ab

8. Let G1 and G2 be grammars with G1 is regular. Is the problem L(G1 ) = L(G2 )


decidable when

(a) G2 is unrestricted
(b) G2 is context free
(c) G2 is regular. [6+6+4]

⋆⋆⋆⋆⋆

2 of 2

You might also like