Docstoc

School of Mathematics, Statistics and Information Technology

Document Sample
School of Mathematics, Statistics and Information Technology Powered By Docstoc
					School of Mathematics, Statistics and Information Technology University of KwaZulu-Natal Computability and Automata (CSCI 313) November Examination 2004

Examiners: Dr N. Pillay Professor A.P. Engelbrecht

Duration: 3 hours

Instructions:
• • Answer each question on a new page. Ensure that your answers are clearly numbered.

This paper consists of four pages including this page. Please ensure that you have all four pages.

University of KwaZulu-Natal, Pmb - November Examination 2004 - Comp CSCI 313

Question 1
1. Given 3 = {a, b} construct a DFA to accept the following language: L = { all strings that contain the substring bb or do not contain the substring aa} 2. 3. Construct a DFA for the language L( (a+b)* ab (a +b)*) 1 L ( (ab)*) Convert the following NFA to a DFA. Show all steps in the conversion. (7) (8)

4.

(7) Reduce the number of states in the following DFA. Show all steps in the reduction.

5.

(6) Convert the following NFA to a regular expression. Show all steps in the conversion.

(6) Page 2

University of KwaZulu-Natal, Pmb - November Examination 2004 - Comp CSCI 313

[34]

Question 2
1. Prove that the grammar S 6 Ab A 6 aAb A60 generates or does not generate the language L = { anbn+1 : n >=0} 2. Given 3 = {a, b, c} construct a context-free grammar that accepts the following language: L = { All strings that do not contain the substring abc} 3. Construct a deterministic pushdown automaton for the following language: L = { anb2n: n>=0} U {ab} 4. Convert the following context-free grammar to a nondeterministic pushdown automaton: S 6 ABaC A 6 BC B6b|0 C6D D6d (7) (5) (6)

(10) [28]

Question 3
1. Construct a Turing machine that accepts the following language: L = { w : w 0 {a, b}+ and the number a’s in w are equal to the number of b’s} 2. (6)

Given 3 = {a, b} construct a Turing machine that takes an even length string as input and marks the middle of the string with c. For example, if abba is the input string then abcba is the output string. (6) Explain how a Turing machine with a stay-option differs from the standard Turing machine. (2) Prove that the Turing machine with a stay-option is equivalent to the standard Turing machine. (5) [19]

3. 4.

Page 3

University of KwaZulu-Natal, Pmb - November Examination 2004 - Comp CSCI 313

Question 4
1. 2. 3. 4. Define the classes of P and NP-complete problems. (4) A problem can be described as decidable or undecidable. What is meant by this? (2) Define the Post Correspondence problem. (3) Prove that the Post Correspondence problem is undecidable. (10) [19]

Page 4


				
DOCUMENT INFO
Shared By:
Stats:
views:20
posted:12/19/2009
language:English
pages:4
Description: School of Mathematics, Statistics and Information Technology