End-Term Examination Second Semester [MCA] MAY-JUNE 2006

Similar documents
SRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN

Automata and Formal Languages

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

Automata and Computability. Solutions to Exercises

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

CS103B Handout 17 Winter 2007 February 26, 2007 Languages and Regular Expressions

C H A P T E R Regular Expressions regular expression

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 4 Nancy Lynch

Philadelphia University Faculty of Information Technology Department of Computer Science First Semester, 2007/2008.

THEORY of COMPUTATION

Model 2.4 Faculty member + student

The Halting Problem is Undecidable

3515ICT Theory of Computation Turing Machines

ÖVNINGSUPPGIFTER I SAMMANHANGSFRIA SPRÅK. 15 april Master Edition

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

Deterministic Finite Automata

Turing Machines: An Introduction

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, School of Informatics University of Edinburgh als@inf.ed.ac.

Computability Theory

How To Compare A Markov Algorithm To A Turing Machine

Pushdown Automata. International PhD School in Formal Languages and Applications Rovira i Virgili University Tarragona, Spain

Chapter 7 Uncomputability

Increasing Interaction and Support in the Formal Languages and Automata Theory Course

Increasing Interaction and Support in the Formal Languages and Automata Theory Course

Compiler Construction

Regular Expressions and Automata using Haskell

MACM 101 Discrete Mathematics I

Theory of Computation Chapter 2: Turing Machines

Scanner. tokens scanner parser IR. source code. errors

Regular Languages and Finite State Machines

Overview of E0222: Automata and Computability

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

Fast nondeterministic recognition of context-free languages using two queues

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

Genetic programming with regular expressions

Informatique Fondamentale IMA S8

Continued Fractions and the Euclidean Algorithm

CAs and Turing Machines. The Basis for Universal Computation

Theory of Computation Class Notes 1

CS 301 Course Information

Local periods and binary partial words: An algorithm

CS 341: Foundations of Computer Science II elearning Section Syllabus, Spring 2015

Fundamentele Informatica II

Math 312 Homework 1 Solutions

Omega Automata: Minimization and Learning 1

Finite Automata. Reading: Chapter 2

FORMAL LANGUAGES AND AUTOMATA THEORY

Course Manual Automata & Complexity 2015

Lecture 2: Universality

24 Uses of Turing Machines

Introduction to Automata Theory. Reading: Chapter 1

CS5236 Advanced Automata Theory

Examination paper for MA0301 Elementær diskret matematikk

Automata on Infinite Words and Trees

The Optimum One-Pass Strategy for Juliet

CMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013

4.6 The Primitive Recursive Functions

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

Computer Architecture Syllabus of Qualifying Examination

Chapter 3. if 2 a i then location: = i. Page 40

Universality in the theory of algorithms and computer science

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

Computational Models Lecture 8, Spring 2009

Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

On the generation of elliptic curves with 16 rational torsion points by Pythagorean triples

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

CHAPTER 7 GENERAL PROOF SYSTEMS

Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy

Degrees that are not degrees of categoricity

Lecture summary for Theory of Computation

FINITE STATE AND TURING MACHINES

INTRODUCTORY SET THEORY

ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear:

PUTNAM TRAINING POLYNOMIALS. Exercises 1. Find a polynomial with integral coefficients whose zeros include

Syllabus of. BCA III (Bachelor of Computer Application) Semester-V

Regular Languages and Finite Automata

1 Definition of a Turing machine

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Mathematical Induction. Lecture 10-11

Push-down Automata and Context-free Grammars

Algebraic Computation Models. Algebraic Computation Models

Theoretical Computer Science (Bridging Course) Complexity

Formal Grammars and Languages

Prime Numbers. Difficulties in Factoring a Number: from the Perspective of Computation. Computation Theory. Turing Machine 電 腦 安 全

OHJ-2306 Introduction to Theoretical Computer Science, Fall

Reading 13 : Finite State Automata and Regular Expressions

Notes on Complexity Theory Last updated: August, Lecture 1

P NP for the Reals with various Analytic Functions

Mathematics Review for MS Finance Students

MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis

Transcription:

(Please write your Roll No. immediately) Roll No. Paper Code: MCA-104 Paper ID: 44104 End-Term Examination Second Semester [MCA] MAY-JUNE 2006 Subject: Theory of Computation Time: 3 Hours Maximum Marks: 60 Note: Answer question 1 and any four of the remaining six questions. Question 1 is of 20 marks and the rest are of 10 marks each. Q. 1 Q. 2 (a) Draw a finite automata that accepts sets of strings composed of zeros and ones which end with string 00. (b) Define an inherently ambiguous language. Give an example of such language. (c) Give a recursive formula for addition of two positive numbers using initial functions like zero, identify and successor functions. Hence show that addition of two positive numbers is computable. (d) Show that if M 1 is a Moore machine then their exists a corresponding Mealy machine. (e) Draw a NFA with three states that accepts L= {a n : n 1} U {b k a m : k 0 m 0}. (4 x 5 = 20) (a) Show that the set of all strings in {0, 1} such that every third symbol is the same as the first symbol is a regular language. (b) Construct a context free grammar for the language L={w w ε {0, 1}*, w is odd and w contains 0 in the middle of the string}. Q. 3 Convert the following Context Free Grammar into GNF. S ba S ab A baa A as A a B abb B bs B b (5, 5) Q. 4 (a) Draw a Push Down Automata with minimum number of pushdown stores of the language {wcw R w ε {0, 1}*}. Here w R is reverse string of w. (b) Give a matrix grammar for the above language. (7, 3)

Q. 5 (a) Define a Turing machine. Draw a Turing Machine that adds two positive integers. (b) State and prove the pumping lemma for CFL. (5, 5) Q. 6 (a) Define Derivation Tree. Is it possible to draw a derivation tree for a string derived from context sensitive grammar? Give reasons for your answer. (5, 5) (b) Let 10011010011 is a symbol sequence. Apply the following prioritized Markov rules to convert the sequence such that all symbols following the pattern 1101 should be 0. (1) a0 0a (2) a1 0a (3) a (4) 1101 1101a (5) Q. 7 Write short notes on any two of the following:- (5, 5) (a) L System of grammar (b) Partial recursive function (c) Unsolvable class or problem. --------------------------------------------------

(Please write your Roll No. immediately) Roll No. Paper Code: MCA-104 End-Term Examination Second Semester [MCA] MAY 2004 Subject: Mathematical Function of Computer Science Time: 3 Hours Maximum Marks: 60 Note: Attempt any six questions. Q. 1 (a) Prove that any set S and its Power set P(S) are not equivalent. The proof should hold for arbitrary sets. 4 (b) Establish the following properties for finite sets 6 (i) if S 1 = n and S 2 = m, then S1 U S2 n + m (ii) S 1 x S 2 = S 1 S 2 (iii) S 1 U S 2 (S 1 S 2 ) = S 2 S 2 represents the compliment of S 2 (w.r.t. Universal set). Q. 2 (a) Minimize the states in the DFA given below :- 5 0 1 0 q 0 q 1 q 2 0 0, 1 q 4 1 1 q s (b) Show that if L is regular, so is the language L R 0, 1 5 Q. 3 (a) Construct a DFA that accepts the language generated by the grammar 5 S aba A bab B aa bb (b) Construct a right-linear grammar for the language L ((aab * ab)*). 5 Q. 4 (a) Is the following language regular? Prove your answer: 4 (i) L = {a n b l : n l } (ii) L= {w w R v : v, w є {a, b} + } 0, 1 q 5

(b) Determine whether or not the following are context free language or not: (i) L= {a n ww R a n : n 0, w є {a, b} * } (ii) L= {a n b m : n = 2 m } (iii) L= {a n b n c j : n j } 6 Q. 5 (a) Construct a non deterministic push down automata for the grammar. 5 A aabb aaa A ABB a B bbb A (b) Design Turing machine to compute the following functions for x and y positive integers represented in unary. 5 (i) (ii) f(x) = 3x f(x, y) = x-y; x > y = 0, x y Q. 6 (a) For ={a, b, c }, find a Post system that generates the following languages : (i) L(a * b + ab * c) (ii) L = (a n b n c n ) 5 (b) Find an L- system that generates L (aa*). 5 Q. 7 (a) Show that every context sensitive language is recursive. 5 (OR) Prove that the Ackermann s function is not primitive recursive. (b) Prove the statement that if a language L 1 is NP-Complete and polynomial time reducible to L 2, then L 2 is also NP-Complete. 5 -----------------------------------

(Please write your Roll No. immediately) Roll No. Paper Code: MCA-104 End-Term Examination Second Semester [MCA] MAY 2003 Subject: Mathematical Foundations of Computer Science Time: 3 Hours Maximum Marks: 60 Note: Attempt any five questions. All questions carry equal marks. Q. 1 (a) Construct a DFA that accepts all strings on {0,1} that have three consecutive zeros. (b) Construct a DFA equivalent to following regular expression 10 + (0+11) 0 *1. Q. 2 Which one of the following language are regular sets. Prove your answer (a) Set of all strings with equal number of zeros and ones. (b) {x w x R x, w in (0 + 1) + } (c) {0 m 1 n 0 m+n m 1 and n 1 } Q. 3 (a) Give context free grammars generating the following sets. {a i b j c k i j or j k} (b) Let G be the Grammar S a B b A A a a S b AA B b b S a BB For the string aaabbabbba find a (i) Left most deviation (ii) Right most deviation (iii) Parse Tree Q. 4 (a) Construct a Push down Automata equivalent to the following grammar. S a AA, A as b S a (b) With a suitable example describe pumping frame for context free language. Q. 5 (a) Prove that a two counter machine can simulate an arbitrary Turing machine. (b) Design a Turing machine to recognize the following languages {ww R w is in (0+1)*} Q. 6 Which of the following properties of recursively enumerable sets are themselves recursively enumerable? Give reasons for your answer. (a) L contains Atleast two strings. (b) L is infinite (c) L is a context free language. (d) L = L R Q. 7 (a) Prove that context free language are not closed under intersection.

(b) Let G1 and G2 be grammars with G1 regular. Is the problem L(G1) =LG(2) decidable when (i) G2 is unrestricted (ii) G2 is regular Q. 8 Write notes on following (a) Non-deterministic Turing Machine (b) Mealy Automation. -------------------------------------------------

(Please write your Roll No. immediately) Roll No. Paper Code: MCA-104 End-Term Examination Second Semester [MCA] JUNE 2001 Subject: Mathematical Foundations of Computer Science Time: 3 Hours Maximum Marks: 70 Note: Attempt five questions in all including Q. 1 which is compulsory. Q. 1. carry 30 marks and Q. 2 to Q. 8 carry 10 marks each. Q. 1 Answer any four parts from the following : (a) Find grammar for = {a, b} that generates the sets of all strings with no more than three a s. (b) What language does the grammar with these productions generate? S Aa, A B, A Aa (c) Find the grammar for the following language on = {a}: L = {w: w mod 3 > 0} (d) Give the DFA for the following language : L= {ab 5 wb 4 : w є {a, b}*} (e) Find the regular grammar for the following language on {a, b}: L= { w : n a (w) and n b (w) are both even} Where n a (w) and n b (w) are number of a and b, respectively in string w (f) Construct a NPDA that accept the following language on {a, b, c} L= {wcw R : W є {a,b}*} Where W R is the reverse of string W. Q. 2 (a) Convert the following NFA to an equivalent DFA 0 1 1 0 q 0 q 1 q 2 λ, 0 0, 1 (b) Convert the grammar S absb / aa in Greibach Normal Form.;

Q. 3 (a) Construct a Turing machine that computes the function f(n, m) = n * m. (b) Let = {a, b} Show that L = {w w R : w є *} is not regular. Q. 4 (a) What language is accepted by the machine M = ({q 0, q 1, q 2,q 3 }, {a, b}, {a, b, Π }, δ, q 0,, q 3 }) With δ (q 0, a) = (q, a, R) δ (q 0, b) = (q 2, b, R) δ (q, b) = (q 1, b, R) δ (q 1, ) = (q 3,, R) δ (q 2, b) = (q 2, b, R) δ (q 2, a) = (q 3, a, R) (b) What is Non-deterministic Turing Machine? Explain with suitable example. Q. 5 (a) Remove all unit production from S Aa B, S A bb, S a bc B (b) What is pumping leema? Discuss its use. Q. 6 Let the Grammar G be defined by : S AB, B A Sb, A Aa bb Given the Derivation tree for the following sequential form : (a) basb (b) baabaab (c) bbabb Can you find an inherently ambiguous context free language? If yes give an example.

Q. 7 (a) Give the regular expression for the following :- a q 1 a q 0 b b a, b a, b (b) Use induction on the size of S to Show that if S is a finite set then 2 S = 2 S Q. 8 Write short notes on any two of the following :- (a) Computational complexity (b) Unrestricted Grammars (c) Closure property for DFL s (d) Mealy Machines ------------------------------------

(Please write your Roll No. immediately) Roll No. Paper Code: MCA-104 End-Term Examination Second Semester [MCA] MAY 2005 Subject: Theory of Computation Time: 3 Hours Maximum Marks: 70 Note: Attempt five questions in all, including Q.1 which is compulsory. Q. 1 Answer the following :- 20 (a) Find the set of strings on T = {a, b } produced by the regular expression b*(a+b)*ab*. (b) Show that Class of CFL is not closed under complement and intersection. (c) What class of language can be generated by grammar with only left context i.e. grammar in which each production is of the form α A αb, where α and β belong to (n U є)*? (d) Prove that {awa w є {a, b}*} is a regular language. (e) Give the matrix grammar for {a n b n c n n > 0}. Q. 2 (a) Differentiate between partial recursive function and Total recursive function. What is bounded minimization? 5 (b) Give the following recursive function 5 A (0, y) =1; A(1, 0) = 2; A(x,0) = x + 2 for all x 2 and A(x +1, y+1) = A(x, y + 1), y) Determine A (3, 2) Q. 3 (a) State and prove the pumping lemma for Regular Language (RL). 5 (b) Show that {a n b n c n n > 0} is not a RL. 5 Q. 4 (a) Define complexity of an algorithm. Show that every logarithmic function f(n) = log b n has the same order as g(n) = log 2 n 5 (b) Define ε-closure set of states in a NFA. How is it used to convert a NFA with ε-move into a DFA without a ε-move. 5 Q. 5 (a) Define Instantaneous Description in a PDA. Draw a PDA for the language {ww w є {0, 1}*}. 7 (b) Describe the same PDA as a sequence of IDs. 3 Q. 6 (a) Define the Turing machine. Draw a Turing machine that concatenate two strings in the alphabet {a, b}. 5

(b) Show that proper subtraction is a total computable function. Draw a Turing machine for this. 5 Q. 7 (a) Check whether G = ({E}, {a, b, c, +, *}, E, P ) where P is given as E E + E E * E a b c is ambiguous. 5 (b) Convert the grammar of part (a) into GNF. 5 Q. 8 Write short notes on any two of the following:- 10 (i) Post-independence Problem. (ii) Universal Turing Machine. (iii) Context- Sensitive Language. -------------------------