Tribhuvan University
Bachelor of Science in Computer Science and Information Technology
Semester 4 · TU Board 2081
Course Title: Theory of Computation (CSC262)
Full Marks: 60Pass Marks: 24Time: 3 hours
Candidates are required to give their answers in their own words as far as practicable. The figures in the margin indicate full marks.
Group A
Attempt any TWO question.(2 × 10 = 20)
- 1.10
Mention the transition function of PDA. List the two ways that PDA accepts the string. Convert the following CFG to PDA.
S → AS | ε
A → Ab | Bb | ab - 2.10
List any two regular operators. Minimize the following finite state machine using Table Filling algorithm.
[figure in the original paper]
- 3.10
Define Turing machine as enumerators of strings of a language. Encode the Turing machine TM = ({q_0, q_1, q_2} , {a, b}, {a, b, B}, δ, q_2, B, F) with input w = ba and δ is defined as follows:
δ(q_0, b) → (q_1, b, R), δ(q_1, a) → (q_2, a, R), δ(q_2, a) → (q_1, a, R), δ(q_2, b) → (q_2, b, L)
Group B
Attempt any EIGHT question.(8 × 5 = 40)
- 4.5
Does machine always refer to hardware? Justify. Define positive closure and Kleene closure.
- 5.5
What is undecidable problem? Discuss about Post Correspondence Problem.
- 6.5
Define the language of a grammar. For the grammar S → 0S0 | 1 | ε, show the leftmost derivation for the string 00100 with its parse tree.
- 7.5
Define ε-closure of a state. Differentiate between Moore and Mealy machine.
- 8.5
Represent the following regular grammar to finite automata.
S → aA | aB | ε
A → aA | aS
B → bB | ε - 9.5
Design the DFA that accepts binary string ending with "00" and show its extended transition function for the string 111000.
- 10.5
Convert the following grammar to CNF.
S → AAB, A → aA | ε, B → ab | a - 11.5
- For the following Turing Machine, test whether the string "( ) ( )" is accepted or rejected and represent it in transition diagram. [5]
State
(
)
X
Y
B
q_0
(q_1, X, R)
–
–
(q_0, Y, R)
(q_3, B, R)
q_1
(q_1, (, R)
(q_2, Y, L)
–
(q_1, Y, R)
–
q_2
(q_2, (, L)
–
(q_0, X, R)
(q_2, Y, L)
–
q_3
–
–
–
(q_3, Y, R)
(q_4, B, R)
q_4
–
–
–
–
– - 12.5
Differentiate between Class P and Class NP problem. Mention the transition function of DFA, NFA, and ε-NFA.
— The End —