You are on page 1of 1

CAIRO UNIVERSITY COMPUTER SCIENCES DEPARTMENT

INSTITUTE OF STATISTICAL Theory of Computation


STUDIES & RESEARCH CS600
November 2017 Model D
TIME: 1.30 HOURS

Q1) Choose True or False. Justify your answers (2 Marks)


1. If R is any regular language and L is any context free language, then 𝐿°𝑅 is
context-free.
2. The language { 𝑎𝑚 𝑏 𝑛 𝑐 𝑛 𝑑 𝑚 | 𝑚, 𝑛 ≥ 0} over Σ = {a,b,c,d} is not context
free.
3. If M = (Q, Σ,δ, q0, F) is a DFA and F = Q then L(M) = Σ ∗ .
4. For a decidable language L. LR may or may not be decidable. (LR denotes
the reverse of language L.)

Q2) Classify each of the following languages to one of the following classes.
(Justify Your Answer) (2 Marks)
1. {𝑎𝑛 𝑏 𝑚 | 𝑚 = 2𝑛 + 1} A. Both Regular and Context-Free
2. {𝑎𝑖 𝑏 𝑗 𝑐 𝑘 | 𝑘 = 𝑖 + 𝑗} B. B Context-Free, but not regular
3. {𝑎𝑖 𝑏 𝑗 𝑎𝑘 | 𝑘 ≠ 𝑖 or 𝑘 ≠ 𝑗} C. Decidable but Neither context-free nor regular
D. Undecidable

Q3) Use the pumping lemma to show that the following language is not regular
(2Marks)
𝑨 = {𝒙𝒌! |𝒌 ∈ {𝟏, 𝟐, 𝟑, … . }}
Q4) Give a context-free grammar for generating the following language
(3Marks)
{𝒂𝒏 𝒃𝒎 𝒄𝒎+𝒏 |𝒏 ≥ 𝟎, 𝒎 ≥ 𝟎}

Q5) Give a formal definition for a PDA that recognizes the language
{𝒘𝒘𝑹 |𝒘 ∈ {𝟎, 𝟏}∗ }. w R is the reverse of w (3Marks)

Q6) Prove Equivalence of DFA and NFA (2Marks)

Q7) Give a formal definition for a Turing machine with one tape that decides
the language {𝒂𝒏 𝒃𝒏 𝒄𝒏 |𝒏 ≥ 𝟎} (5 Marks)

Q8) PDA-2 is a pushdown automaton with Two stacks (5Marks).


Show that PDA-2s are more powerful than conventional PDAs with only One
stack (Give a language recognizable by a PDA-2 but not by PDA-1 and give
the informal description of the implementation).
Q9) Prove that any finite language is regular(2Marks).

Model D

You might also like