You are on page 1of 10

Code No: RR310504 Set No.

1
III B.Tech I Semester Supplimentary Examinations, November 2007
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) Let R={(1, 2), (2, 2), (2, 3)} be a relation on the set {1, 2, 3}, Find R*.
(b) Develop a Deterministic Finite Automation accepting the language given over
the alphabet {0, 1}. L = {the set of all strings such that every block of five
consecutive contain at least two o’s}
(c) Give mathematical definition of NFA and state main differences between NFA
and DFA. [4+8+4]

2. (a) Construct DFA for the NFA-E Figure 2a shown below.

Figure 2a
(b) Construct a Mealy machine equivalent to the Moore machine given by the
following table. [8+8]
a=0 a=1 Output
qi +1 qi +1
q0 q1 q2 1
q1 q3 q2 0
q2 q2 q1 1
q3 q0 q3 1

3. (a) Construct FA equivalence to the following regular expression


r = ((0 + 1(1 + 01)∗ 00)∗
(b) Give the regular expressions accepted by following FA. Figure 3 [8+8]

1 of 2
Code No: RR310504 Set No. 1

Figure 3
4. (a) Construct regular grammar G generating the regular set a∗ b(a + b)∗ .
(b) Define CFG and give examples. What is CFL generated by the grammar
S → abB, A → aaBb, B → bbAa, A → E [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. Construct Turing machine to accept following language and give its state transition
table and diagram. Check the machine by tracing a suitable instance.
L = { an bm : n≥ 1 and n 6= m}. [16]

7. Construct LR(0) items for the grammar given, find its equivalent DFA. Check the
parsing by taking a suitable derived string.
S → E
E → E + T |T [8+8]
T → a | (E)

8. (a) Define P and NP problems, give some examples for these problems.
(b) Explain why PCP with two lists x = (01,1,1) y = (0101,10,11) has no solution.
What is modified PCP problem? [6+10]

⋆⋆⋆⋆⋆

2 of 2
Code No: RR310504 Set No. 2
III B.Tech I Semester Supplimentary Examinations, November 2007
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. Define NFA mathematically. Explain its significance and function. Convert the
given Finite automaton into its Deterministic equivalence. Explain method used.
Taking suitable example and prove both accept the same string. Figure 1 [16]

Figure 1
2. (a) Define NFA- ∈ transitions and write the differences between NFA- and ordi-
nary NFA.
(b) Find NFA without ∈ for the following Figure 2b

Figure 2b
(c) Construct state transition table for the following Moore machine. Figure 2c
[4+4+8]

1 of 3
Code No: RR310504 Set No. 2

Figure 2c
3. (a) Construct the NFA for the regular expression r = 0*1 ((0+1)0*1)* (∈+(0+1)
(00)*)+0(00)*
(b) Consider the FA and construct regular expressions that is accepted by it.
Figure 3 [8+8]

Figure 3
4. (a) For the following finite state automata construct equivalent grammar. Figure
4a

Figure 4a
(b) What is meant by ambiguous grammar? Test whether the grammar is am-
biguous or not. S → ABA, A → aA/∧ , B → bB/∧ [8+8]

5. (a) Obtain a PDA to accept the language {L = an b2n / n ≥ 1}.


(b) Convert the following grammar to GNF
S → Ba/ab
A → aAB/a
B → ABb/b [8+8]

6. (a) Explain how a “RAM computer” can be simulated using Turing Machine.

2 of 3
Code No: RR310504 Set No. 2
(b) Design a Turing machine to multiply two integers. Taking this as a block
given the block diagram to find factorial of an integer. [6+10]

7. (a) Define the ‘Handler’. For the derivation aabb find the viable prefixes of the
grammar shown below.
S′ → S
S → aS b|ab
(b) When an item is said to be complete, find the sets of LR(0) items. [8+8]

8. (a) Differentiate NP complete and NP hard problems. Explain NP complete and


NP Hard problems with some examples.
(b) What is undecidability? Explain PCP and modified PCP in detail. [8+8]

⋆⋆⋆⋆⋆

3 of 3
Code No: RR310504 Set No. 3
III B.Tech I Semester Supplimentary Examinations, November 2007
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 state transition table given find the state transition diagram. Check whether
the string 00101011 is accepted or not. Determine equivalent DFA and check for
the same string and prove both are equivalent. q0 is the initial state and q2 is the
final state. [8+8]
q/Σ 0 1
q0 {q0 , q1 } {q1 }
q1 {q1 , q2 } {q2 }
q2 φ {q0 , q2 }
q3 {q0 , q3 } {q3 }

2. For the NFA- ∈ given check whether the string aannanan is accepted or not, If
accepted write the transition path. Find the equivalent NFA without epsilon tran-
sitions, explain the procedure used and check the string given on your new NFA.
Figure 2 [16]

Figure 2
3. (a) Construct FA equivalence to the following regular expression
r = 10+(0+11)0*1
(b) Describe a pumping lemma. What are its applications?
(c) Consider the transitions system. What type of strings are accepted by it.
Figure 3 [6+6+4]

Figure 3

1 of 2
Code No: RR310504 Set No. 3
4. (a) Construct a Finite automata recognizing the following regular grammar.
S→ aS / bA / b
A→ aA / bS / a
(b) Generate CFG for the language
L = {an bm : n 6= m} [8+8]

5. (a) Construct PDA to accept the CFG and verify by a suitable example.
S → aABC
A → aB / C
B → bA / b
C→a
(b) Convert the following grammar to GNF
S → AA / a
A → SS /b [8+8]

6. Construct Turing machine to accept following language and give its state transition
table and diagram. Check the machine by tracing a suitable instance.
L = { an bn an bn / n ≥ 1}. [16]

7. Construct LR(0) items for the grammar given, find its equivalent DFA. Check the
parsing by taking a suitable derived string. λ is null.
E → T E′
E′ → + T E′ | λ
T → F T′ [8+8]
T′ → ∗F T′ |λ
F → id

8. (a) Define P and NP problems, give some examples for these problems.
(b) Explain why PCP with two lists x = (01,1,1) y = (0101,10,11) has no solution.
What is modified PCP problem? [6+10]

⋆⋆⋆⋆⋆

2 of 2
Code No: RR310504 Set No. 4
III B.Tech I Semester Supplimentary Examinations, November 2007
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) “If a Language L is accepted by an NFA then there will be a DFA which
accepts same L”. Prove or explain with algorithm.
(b) Determine the DFA equivalent to the following NFA and by taking suitable
example prove that both will accept or reject the same set of strings. Figure
1 [8+8]

Figure 1
2. (a) Constance state Transition Table for the Moore machine given in Figure 2a
below.

Figure 2a
(b) Construct Moore machine for the Melay machine in Figure 2b

1 of 3
Code No: RR310504 Set No. 4

Figure 2b
(c) Construct a minimum automation equivalent to a given automation. [4+6+6]
α A b Output
q0 q1 q2 0
q1 q2 q3 0
q2 q3 q4 1
q3 q4 q4 0
q4 q0 q0 0

3. (a) Construct the NFA for the regular expression r = 0*1 ((0+1)0*1)* (∈+(0+1)
(00)*)+0(00)*
(b) Consider the FA and construct regular expressions that is accepted by it.
Figure 3 [8+8]

Figure 3
4. (a) Construct regular grammar G generating the regular set a∗ b(a + b)∗ .
(b) Define CFG and give examples. What is CFL generated by the grammar
S → abB, A → aaBb, B → bbAa, A → E [8+8]

5. (a) Convert the following to GNF


E → E + T/T

2 of 3
Code No: RR310504 Set No. 4
T → T * F/F
F → (E)/a
(b) Construct PDA generating all odd palindromes over string {a, b, c}. [8+8]

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. Construct LR(0) items for the grammar given, find its equivalent DFA. Check the
parsing by taking a suitable derived string.
S → E
E → E + T |T [8+8]
T → a | (E)

8. (a) Define P and NP problems, give some examples for these problems.
(b) Explain why PCP with two lists x = (01,1,1) y = (0101,10,11) has no solution.
What is modified PCP problem? [6+10]

⋆⋆⋆⋆⋆

3 of 3

You might also like