0% found this document useful (0 votes)
52 views2 pages

CS2004

This document describes a formal languages and automata theory exam with 11 questions. It begins by defining Turing machines and linear bounded automata. The questions ask the student to: 1) Construct an LBA for a specific language 2) Construct a Turing machine for another language 3) Prove nondeterministic Turing machines are equivalent to deterministic ones 4) Describe how a universal Turing machine encodes other Turing machines 5) Prove the halting problem is undecidable 6) Construct PDAs for two related languages 7) Determine if deterministic context-free languages are closed under union 8) Compare different grammar types and construct a DFA 9) Convert a grammar to Chomsky normal

Uploaded by

Satya Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views2 pages

CS2004

This document describes a formal languages and automata theory exam with 11 questions. It begins by defining Turing machines and linear bounded automata. The questions ask the student to: 1) Construct an LBA for a specific language 2) Construct a Turing machine for another language 3) Prove nondeterministic Turing machines are equivalent to deterministic ones 4) Describe how a universal Turing machine encodes other Turing machines 5) Prove the halting problem is undecidable 6) Construct PDAs for two related languages 7) Determine if deterministic context-free languages are closed under union 8) Compare different grammar types and construct a DFA 9) Convert a grammar to Chomsky normal

Uploaded by

Satya Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

NATIONAL INSTITUTE OF TECHNOLOGY ROURKELA

End Semester Examination, Spring 2022


Subject: Formal Languages and Automata Theory Subject Code: CS2004 Full Marks: 50
Time: 3 hours Number of pages: 2
Questions 1 – 10 are mandatory. Any marks fetched in Question 11 will be added to the
secured marks and scaled to 50. Mere answer without justification will not fetch any mark.
P P
A Turing machine M can be either defined P by a 7 tuple (Q, , τ, δ, q0 , , F ) or (Q, , τ, δ, q0 ,
qaccept , qreject ), where Q is the
Pset of states, is the set of input alphabet, τ is the set of tape symbols,
blank symbol (ort) ∈ τ , ⊂ τ , δ : Q × τ → Q × τ × {L, R} is the transition function, q0 is the
start state, F denotes the set of final states in the first model, qaccept denotes the single final state and
qreject denotes the single reject state in the second model.
1. Construct an LBA (Linear Bounded Automata) that accepts the following language 5 marks
L1 = {an bn cn : n ≥ 1} (Recall that a Linear bounded automata is a special type
of Turing machine). Define the LBA as a Turing machine and draw the state
transition diagram for LBA recognizing L1 .
2. Construct a Turing machine for the following language.
L2 = {w#w : w ∈ {0, 1}∗ , # is a special tape symbol.}. 5 marks

3. Define a Nondeterministic Turing machine. Prove that any Nondeterministic 5 marks


Turing machine has the same computation power as a Deterministic Turing
machine (you may assume that any Deterministic Turing machine has the
same computational power as a Multidimensional Turing machine).
4. Describe the procedure of encoding done by the Universal Turing machine to 5 marks
encode any arbitrary Turing machine.
5. Consider the following computational problem. 5 marks
Input: A Turing machine M , a string w.
Question: Decide whether M halts while processing w.
The corresponding language is given by
HT M = {hM, wi : M is a Turing machine that halts on string w}.
Prove that HT M is undecidable (Use the fact that there exists a language that is Turing
acceptable whose complement is not Turing acceptable).

6. Construct a PDA for the following language. 5 marks


R ∗ R
L6 = {vv : v ∈ {a, b} , v denotes the reverse of the string v}.
Can a Deterministic PDA accept L6 ? Construct a Deterministic PDA that
accepts RL6 = {vcv R : v ∈ {a, b}∗ , v R denotes the reverse of the string v, c 6= a, c 6= b}.

7. Are the class of Determisitic Context-free Languages closed under union? Justify 5 marks
your answer with a suitable example. (You may either give a formal proof that
DCFL’s are closed under union or give a counter example showing that they are
not closed. In the latter case, you must prove that the two input languages are DCFL
and prove that their union is not a DCFL. You may assume that an bn cn , n ≥ 1, is
not context free).

8. Differentiate between Regular, Context-free, Context-sensitive and Unrestricted 5 marks


grammar, with suitable examples. Design a DFA D for the following language.
L8 = {w ∈ {a, b}∗ : |w| ≥ 2, and the second to last symbol from right of w is b}.
For instance, D accepts aabb, but rejects abab.

1
9. Consider the following grammar G = (V, T, R, S): 5 marks
V = {S, A, B} is the set of variables;
T = {a, b} is the set of terminals;
S is the start variable;
R is the set of production rules as given below.
S → ASA|aB
A → B|S
B → b|.
Convert G to an equivalent grammar H in Chomsky Normal Form.
10. (a) Prove that L10a = {ww : w ∈ {a, b}∗ } is not regular. 2.5 marks

(b) Write the context free grammar that generates the following language.
L10b = {ai bj ck : i, j, k ≥ 0, i = k or i = j}. 2.5 marks

11. Consider the computational problem of deciding whether 5 marks


L(M ) is regular given that M is a Turing machine. The corresponding language
be RegularT M .
RegularT M = {hM i : M is a Turing machine that accepts a regular language}.
Prove that RegularT M is undecidable.
(Hint. Use techniques similar to one used to prove that EmptyT M is undecidable.)

−−F−−

You might also like