Download Theory of Automata-Computer Science-Assignment and more Exercises Theory of Automata in PDF only on Docsity! WARNING 1. PLAGIARISM OR H IRING OF G HOST WRITER(S) FO R SOLV ING THE ASS IGNMENT(S) WILL D EBAR THE ST UDENT FR OM AW ARD OF DEGREE/CERTIFICATE, IF FOUND AT ANY STAGE. 2. SUBMITTING ASSIGNMENTS BORROWED OR ST OLEN FR OM OTHER(S) AS ONE ’S OWN WILL BE PEN ALIZED A S DEFINE D I N “ PLAGIARISM POLICY”. Course: Theory of Automata (3452) Semester: Spring, 2012 Level: BS (CS) Total Marks: 100 Pass Marks: 50 ASSIGNMENT No. 1 (Units: 1–4) Note: All questions are compulsory. All questions carry equal marks. Q. 1 (a) Explain the following terms: i) Automata ii) Set theory (b) For the following relations between sets A and B mention if they are one to one and/or onto: A = {a, b, c} B = {1, 2, 3} i) {(a, 1), (b, 1), (c, 1)} ii) {(a, 2), (b, 2), (c, 2)} iii) {(a, 1), (a, 2), (b, 2), (c, 3)} iv) {(a, 2), (b, 1), (c, 2)} Q. 2 (a) Consider the language S*, where S= {aa b}. How many words does this language have of length 4? Of length 5? What can be said in general? (b) Construct a regular expression defining each of the following languages over the alphabet ∑ = {a b}: i) All words in which a appears tripled, if at all. This means that every clump of a’s contains 3 or 6 or 9 or 12… a’s. ii) All strings that have exactly one double letter in them. iii) All words that contain exactly two b’s or exactly three b’s, not more. Q. 3 (a) What is the relationship between regular languages and context free grammars? Discuss them? Construct a language that can be generated by CFG. docsity.com 2 (b) Consider the Context Free Grammar S a X X a x | b X | Λ Y b b b (a +b) * b b b (a + b) * Q. 4 (a) Construct an example DFA? Write down the steps to convert FA into DFA. (b) Construct DFA for the following regular expression: (a / b) * a b *. Q. 5 Define and explain the following terms. (a) Context Free Grammar (b) Regular Expression (c) Context Free Language (d) Deterministic Finite Automata ASSIGNMENT No. 2 (Units: 5–8) Total Marks: 100 Pass Marks: 50 Q. 1 (a) What is a regular language? How it can be differentiated from a non-regular language? (b) Show whether the language (0^p 1^100) for all integer p, with 0<p<100, is a regular language or a non-regular language. Q. 2 (a) Define and explain Push Down Automata with the help of a suitable example. (b) Write a Push Down Automaton to accept the langue {0^n 1^n 0^m 1^m, for all n,m>=0. Q. 3 Explain the following terms with suitable examples: (a) Greibach Normal Form (b) Chomsky Normal Form (c) Closure properties of Regular Languages (d) Non-Deterministic Finite Automata Q. 4 Define and explain the term parsing with the help of a suitable example. Discuss the types of parsing in detail. Q. 5 What is standard turing machine? Explain with the help of examples. docsity.com