You are on page 1of 3

B.

TECH (SIXTH SEMESTER)


Examination, 2020
CS / IT
Paper CS 315 - Theory of Computation
Maximum Marks – 60
The question paper is divided into three Sections. Students
are required to attempt five questions in all, selecting not
more than two questions from each Section.

Sec-A

1. (a) “Any gadget / object / Service that you use in your day-to-day life, can be modeled as
DFA”. Justify this statement by constructing a DFA for any one of the following.
i. Communication Protocol
ii. Text Parsing
iii. Traffic sensitive traffic lights.
[8 Marks]
1. (b) Construct a right linear and left linear grammar for language L ((b*a + aa*b) *)
[4 Marks]

2. (a) Let L be a language over the alphabet Σ={2,7,+} consisting of strings representing valid
arithmetic expressions in base-10 that evaluate to an odd number. Numbers can have multiple
digits.
Examples of strings in L:
27 22+77+72 2727+772
Examples of strings not in L:
77+727 22 727+22+72

Give an explanation as to why L is a regular language.


[8 Marks]

2. (b) Prove the formula:


(00*1)*1  1  0(0  10)*11
[4 Marks]

3. (a) Let Ln = { x ε (0,1)* ; | x | ≥ n and the nth symbol from the right in x is 1}. Draw an FA
with four states that recognizes L2. For any n ≥ 1, describe how to construct an FA with 2n states
that recognizes Ln.
[6 Marks]
n!
3. (b) Prove or disprove that L={a | n ≥ 0} is not regular.
[6 Marks]
Sec-B

4. (a) State whether the following L is context-free and not regular, or neither context-free nor
regular. L = {x ε (a, b)* ; | x | is even and the first half of x has one more a than does the second
half}.
[6 Marks]
4. (b) Show that L is accepted by PDA in which no symbols are ever removed from the stack,
then L is regular.
[6 Marks]

5. (a) Consider the diagram given below of a PDA which accepts by reaching to final state:

i. Give the description of the language which is accepted by this PDA.


ii. How this PDA can be converted to a single-state PDA.
iii. Give an equivalent CFG for the single-state PDA above.
[2+3+3 = 8 Marks]

5. (b) Why do CFGs have more power than regular expressions? Justify with the help of their
applications.

[4 Marks]

6. Construct CFG for the following


a) {w ε (0, 1)* | w = wR and |w| is even }.
b) { ai bj ck | i, j, k ≥ 0, and i = j or i = k }.
c) {ai bj ck | i ≠ j or j ≠ k}.
d) All strings over {a , b} containing an unequal number of a's and b's.
[4*3=12 Marks]
Sec-C

7. (a) A queue machine is like a Turing machine, except that it has a queue instead of a tape. It
has a finite queue alphabet Γ and a finite input alphabet Σ ⊆ Γ. If x ∈ Σ* is the input, the machine
starts in its start state s with x$ in the queue, where $ is a special symbol in Γ − Σ. In each step, it
removes a symbol from the front of the queue. Based on that symbol and the current state, it
pushes a string z ∈ Γ* onto the back of the queue and enters a new state according to the
transition function δ. It accepts by emptying its queue.

i. Give a rigorous formal definition of these machines, including a definition of


configurations and acceptance. Your definition should begin as follows: “A queue
machine is a six tuple M = (Q, Σ, Γ, $, δ, s), where … ”.
ii. Prove that queue machines and Turing machines are equivalent in power.
[4 + 4= 8 Marks]

7. (b) Construct a TM to compute „n mod 2‟ when n is represented in the tape in unary form
consisting of only 1‟s.
[4 Marks]

8. (a) Show that the Predecessor and Subtraction ( ) functions are Primitive Recursive.

[4+4 Marks]
8. (b) Show that PCP is decidable over a unary alphabet.

[4 Marks]

9. A ray automaton consists of an infinite number of deterministic finite automata A0, A1, A2...
arranged in a line. The automata all have the same set of states Q, the same start state s, and the
same transition function δ except A0, which has a different transition function δ 0 since it has no
left neighbour. They all start simultaneously in their initial state s and execute synchronously. In
each step, each Ai moves to a new state, depending on its own current state and the current states
of its immediate left and right neighbors, according to its transition function. The ray automaton
is said to halt if A0 ever enters a distinguished final state t. There is no input alphabet.

(a) Give a rigorous formal definition of ray automata, including a definition of execution and
halting. Your definition should begin as follows: "A ray automaton is a quintuple A = (Q, s, t,
δ0, δ), where Q is a finite set of states..."

(b) Prove that the halting problem for ray automata is undecidable.

[6 + 6 = 12 Marks]

You might also like