0% found this document useful (0 votes)
39 views4 pages

CAT 3 - SCS201 - Theory of Computation - Open Book Questions

Uploaded by

ogallomiltone7
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)
39 views4 pages

CAT 3 - SCS201 - Theory of Computation - Open Book Questions

Uploaded by

ogallomiltone7
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/ 4

MURANG’A UNIVERSITY OF TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE


SCS201: THEORY OF COMPUTATION
CAT 3.
DATE OF SUBMISSION: 28TH NOVEMBER, 2024

A. BSC. COMPUTER SCIENCE GROUP

Instructions: Answer all Questions

1) Consider the regular expression (ab + ab)*:


a) Construct a non-deterministic inite automaton (NFA) accepting this language (4 marks)
b) Convert your NFA to a deterministic inite automaton (DFA) (4 marks)
c) Minimize the resulting DFA (4 marks)
d) Prove that your minimized DFA is correct by showing it accepts exactly the same language
as the original regular expression (4 marks)
e) Provide a pumping lemma-based proof that this language is regular (4 marks)

2) Given the context-free grammar G with productions: S → aSb | aAb A → aAb | ab


a) Convert this grammar to Chomsky Normal Form (4 marks)
b) Construct a pushdown automaton (PDA) that accepts L(G) (4 marks)
c) Prove that your PDA accepts exactly L(G) (4 marks)
d) Show a step-by-step parsing of the string "aaabbb" using your PDA (4 marks)
e) Determine if the language is deterministic context-free and justify your answer (4 marks)

3) For the language L = {anbn | n ≥ 0}:


a) Design a PDA using empty stack acceptance (4 marks)
b) Convert your PDA to one using inal state acceptance (4 marks)
c) Construct an equivalent context-free grammar (4 marks)
d) Prove the equivalence of your PDA and CFG (4 marks)
e) Show that L is not regular using the pumping lemma (4 marks)

4) Design a Turing machine that:


a) Accepts the language {wwR | w ∈ {a,b}*} (4 marks)
b) Convert your TM to a multi-tape TM that improves ef iciency (4 marks)
c) Analyze the time complexity of both machines (4 marks)
d) Prove they accept the same language (4 marks)
e) Show a complete computation for the input "abba" (4 marks)
5) Consider the language L = {anbncn | n ≥ 0}:
a) Prove that L is not context-free using the pumping lemma (4 marks)
b) Design a Turing machine accepting L (4 marks)
c) Convert your TM to a Post machine (4 marks)
d) Prove the equivalence of your TM and Post machine (4 marks)
e) Show a sample computation on "aabbcc" for both machines (4 marks)

6) For the regular expression (a + b)aba(a + b):


a) Construct an NFA using Thompson's construction (4 marks)
b) Convert to a DFA using subset construction (4 marks)
c) Minimize the DFA (4 marks)
d) Give a regular grammar generating this language (4 marks)
e) Prove the equivalence of your grammar and the original regular expression (4 marks)

7) Design universal machines:


a) Construct a universal Turing machine (4 marks)
b) Convert it to a universal Post machine (4 marks)
c) Prove their equivalence (4 marks)
d) Analyze their ef iciency (4 marks)
e) Show how they simulate a simple computation (4 marks)

8) Design and analyze a Turing machine that:


a) Multiplies two unary numbers (4 marks)
b) Convert it to a Post machine (4 marks)
c) Prove their equivalence (4 marks)
d) Analyze the time complexity (4 marks)
e) Show a complete computation for input "111#11" (4 marks)
MURANG’A UNIVERSITY OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE
SCS201: THEORY OF COMPUTATION
CAT 3.
DATE OF SUBMISSION: 28TH NOVEMBER, 2024

B. BSC. COMPUTER TECHNOLOGY GROUP

Instructions: Answer all Questions

1) For the language L = {w#w | w ∈ {a,b}*}:


a) Prove L is not context-free (4 marks)
b) Design a single-tape TM accepting L (4 marks)
c) Convert to a two-tape TM (4 marks)
d) Compare the ef iciency of both machines (4 marks)
e) Provide detailed transition functions for both machines (4 marks)

2) Consider the PDA and CFG equivalence:


a) Give a systematic procedure for converting PDAs to CFGs (4 marks)
b) Give a systematic procedure for converting CFGs to PDAs (4 marks)
c) Prove these procedures are inverses (4 marks)
d) Apply both procedures to a non-trivial example (4 marks)
e) Discuss the practical implications of this equivalence (4 marks)

3) For regular expressions and inite automata:


a) Prove Kleene's theorem (regular sets = regular expressions) (4 marks)
b) Demonstrate the conversion from regular expressions to NFAs (4 marks)
c) Show the conversion from NFAs to regular expressions (4 marks)
d) Analyze the complexity of these conversions (4 marks)
e) Apply both conversions to a complex example (4 marks)

4) For the language L = {w | w contains equal numbers of a's and b's}:


a) Give a PDA accepting L (4 marks)
b) Convert to an equivalent CFG (4 marks)
c) Prove their equivalence (4 marks)
d) Show the grammar is ambiguous (4 marks)
e) Give an unambiguous grammar for L (4 marks)
5) Given the context-free grammar: S → AB A → aAb | ε B → bBa | ε
a) Show this grammar is ambiguous (4 marks)
b) Construct an equivalent unambiguous grammar (4 marks)
c) Design a PDA accepting the language (4 marks)
d) Prove your PDA accepts exactly the language generated by the grammar (4 marks)
e) Describe a practical application of this language (4 marks)

6) Consider decidability questions:


a) Prove the halting problem is undecidable (4 marks)
b) Prove Post's Correspondence Problem is undecidable (4 marks)
c) Reduce the halting problem to PCP (4 marks)
d) Show the equivalence problem for TMs is undecidable (4 marks)
e) Discuss the implications for practical computing (4 marks)

You might also like