Professional Documents
Culture Documents
Toc Question Set
Toc Question Set
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
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]
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]
⋆⋆⋆⋆⋆
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]
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
⋆⋆⋆⋆⋆
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
⋆⋆⋆⋆⋆
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]
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]
(a) G2 is unrestricted
(b) G2 is context free
(c) G2 is regular. [6+6+4]
⋆⋆⋆⋆⋆
2 of 2