cs402 collection of old papers

30
Connecting VU Students Page 1 of 4 CS402 Theory of Automata Final Term Examination - February 2004 Session -II Time Allowed: 150 Minutes Please read the following instructions carefully before attempting any question: 1. The duration of this examination is 150 Mins. 2. This examination is closed book, closed notes, closed neighbors; any one found cheating will get no grade. 3. Do not ask any questions about the contents of this examination from anyone. a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding. b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem. 4. Most, but not all, of the examination consists of MCQ's. Choose only one choice as your answer. 5. You are allowed to use any Software for Diagrams and Symbols like MS Word, Math Type and Visio etc. Total Questions 12 Q No. 1 Choose the right option: (2) A) aAbB is a string defined on an alphabet {aA, bB, aAbB}. B) aAbB is a string defined on an alphabet {aA, bB}. o B only o A only Q No. 2 Choose the right option: (2) A) For every NFA, there may not be an FA equivalent to it B) For every NFA, there must be an FA equivalent to it o B only o A only Q No. 3 Choose the right option: (2) A) In a Mealy machine, the set of letters and the set of output characters must be same B) In a Mealy machine, the set of letters and the set of output characters may not be same o B only o A only

Upload: httpmajidvacom

Post on 04-Apr-2015

227 views

Category:

Documents


18 download

DESCRIPTION

CS402 COLLECTION OF OLD PAPERS

TRANSCRIPT

Page 1: Cs402 Collection of Old Papers

Connecting VU Students

Page 1 of 4

CS402 Theory of Automata Final Term Examination - February 2004

Session -II

Time Allowed: 150 Minutes

Please read the following instructions carefully before attempting any question: 1. The duration of this examination is 150 Mins. 2. This examination is closed book, closed notes, closed neighbors; any one found

cheating will get no grade. 3. Do not ask any questions about the contents of this examination from anyone.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

4. Most, but not all, of the examination consists of MCQ's. Choose only one choice as your answer.

5. You are allowed to use any Software for Diagrams and Symbols like MS Word, Math Type and Visio etc.

Total Questions 12 Q No. 1

Choose the right option: (2) A) aAbB is a string defined on an alphabet {aA, bB, aAbB}. B) aAbB is a string defined on an alphabet {aA, bB}.

o B only o A only

Q No. 2 Choose the right option: (2) A) For every NFA, there may not be an FA equivalent to it B) For every NFA, there must be an FA equivalent to it

o B only o A only

Q No. 3

Choose the right option: (2) A) In a Mealy machine, the set of letters and the set of output characters must be

same B) In a Mealy machine, the set of letters and the set of output characters may not be

same o B only o A only

Page 2: Cs402 Collection of Old Papers

Connecting VU Students

Page 2 of 4

Q No. 4

Choose the right option: (2) A) Pumping Lemma version I is sufficient to test an infinite language to be regular B) To test an infinite language to be regular, Pumping Lemma version I may not help

o B only o A only

Q No. 5

Choose the right option: (2) A) For a given CFG, there may not exist any PDA accepting the language generated by

the CFG B) For a given CFG, there must be a PDA accepting the language generated by the

CFG o B only o A only

Q No. 6

Identify the language accepted by the following PDA. Build an FA accepting the corresponding language. Write the corresponding RE as well (10)

Q No. 7

Derive any two words of length 4 from the following CFG. (5) S®XaaX, X®aX|bX|L

Page 3: Cs402 Collection of Old Papers

Connecting VU Students

Page 3 of 4

b

Q No. 8

Determine the CFG, corresponding to the following FA (5)

a

b

a C+

b

A

a

a

b D+

a

B

b S–

Q No. 9 By identifying at least 4 strings of length 4 each, determine the language accepted by the following FA (5)

b

a

a

b +

a

b

b

a +

b

a –

Q No. 10 Using complementing and incrementing technique, subtract 67 from 83. (convert the numbers to the binary form first) (5)

Q No. 11

Construct the transition table of the following Mealy machine (5)

Page 4: Cs402 Collection of Old Papers

Connecting VU Students

Page 4 of 4

a/0

b/1 q1

a/0

b/1

q2

q0 q3 a/1b/0

a/1 b/1

Q No. 12 Show that the strings aabb and aaabbb of the language L = {anbn: n = 1, 2, 3, …} does not fulfill the conditions of Pumping Lemma Version I. (5)

Page 5: Cs402 Collection of Old Papers

Connecting VU Students

Page 1 of 4

CS402 Theory of Automata Final Term Examination - February 2004

Session -1

Time Allowed: 150 Minutes

Please read the following instructions carefully before attempting any question: 1. The duration of this examination is 150 Mins. 2. This examination is closed book, closed notes, closed neighbors; any one found

cheating will get no grade. 3. Do not ask any questions about the contents of this examination from anyone.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

4. Most, but not all, of the examination consists of MCQ's. Choose only one choice as your answer.

5. You are allowed to use any Software for Diagrams and Symbols like MS Word, Math Type and Visio etc.

Total Questions 12 Q No. 1

Choose the right option: (2) A) The language EQUAL of strings with number of a's equal to number of b's, S = {a,

b}, is regular language. B) The language EQUAL of strings with number of a's equal to number of b's, S = {a,

b}, is not regular language. o B only o A only

Q No. 2

Choose the right option: (2) A) Concatenation of any two strings of Lo (a + b)*(aa + bb)*(a + b)* may not belong to L B) Concatenation of any two strings of Lo (a + b)*(aa + bb)*(a + b)* must belong to L

o B only o A only

Q No. 3

Choose the right option: (2) A) The set of input letters and the set of output characters in a Moore machine, may

not be same B) The set of input letters and the set of output characters in a Moore machine, must

be same o B only

Page 6: Cs402 Collection of Old Papers

Connecting VU Students Page 2 of 4

o A only

Q No. 4 Choose the right option: (2) A) A sequential circuit is an example of Mealy machine B) A sequential circuit can't be considered to be an example of Mealy machine

o B only o A only

Q No. 5

Choose the right option: (2) A) There does not exist any CFG defining a regular language B) There is at least one CFG defining a regular language

o B only o A only

Q No. 6

Identify the language accepted by the following PDA. Build an FA accepting the corresponding language. Write the corresponding RE as well (10)

Q No. 7

Derive any two words of length 4, from the following CFG. (5) S®aXb, X®aX|bX|L

Q No. 8

Determine the CFG corresponding to the following FA (5)

Page 7: Cs402 Collection of Old Papers

Connecting VU Students

Page 3 of 4

Q No. 9

By searching at least 4 strings of length 4 each, determine the language accepted by the following FA (5)

0

1

0

1

1 0

0,1

- +

x

y

Q No. 10

Using complementing and incrementing technique subtract 89 from 97, (convert the numbers to the binary form first) (5)

Q No. 11

Construct the transition table for the following Moore Machine (5)

q2/0b a

aq1/0 q3/1b q0/0

a

bb

a

Page 8: Cs402 Collection of Old Papers

Connecting VU Students

Page 4 of 4

Q No. 12 Show that the pumping Lemma Version I, is satisfied by PALINDROME defined on S = {a, b} (5)

Page 9: Cs402 Collection of Old Papers

o All words of all languages over Σ

o All strings over Σ

o All languages over Σ

A Total Language Tree has

Question No. 1 Marks : 02 Total Marks: 50 Total Questions: 09

**WARNING: Please note that Virtual University takes serious note of unfair means. Anyone found involved in cheating will get an `F` grade in this course.

4. You are allowed to use any Software for Diagrams and Symbols like MS Word, MathType and Visio etc.

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

3. Do not ask any questions about the contents of this examination from anyone.

b. You will have to answer correctly all questions in this examination to get the maximum possible marks.

a. There is no choice. 2. Answer all questions. 1. This examination is closed book, closed notes, closed neighbors.

Please read the following instructions carefully before attempting any question:

Instructions

Time Allowed: 150 Minutes Final Term Examination – Spring 2005

CS402 Theory of Automata

www.vujannat.ning.com

Page 10: Cs402 Collection of Old Papers

q0

q1

q2

q3

1/0

1/00/0

0/1

0/1

0/0

1/1

1/0

(a) Draw Moore Machine equivalent to following Mealy Machine. (5) Question No. 4 Marks : 10

Head

oo Word

o Tape o Stack

What Turing Machine does not have? Question No. 3 Marks : 02

–S b

B

a

D+

a

a

b

A

b

C+

b

a

b

a

(b) Determine the CFG, corresponding to the following FA (5) Write the corresponding RE as Well. (5) S→XaaX, X→aX|bX| . (a) Derive any two words of length 4 from the following CFG.

Question No. 2 Marks : 10

o All words of one language over Σ

Page 11: Cs402 Collection of Old Papers

Question No. 8 Marks : 10

oo b*(aa)*b*

o b*aab*

b*aa o aab*

CFG given S bS|Sb|aa represents language

Question No. 7 Marks : 02

oo None of above

o They reject same words

They accept same words o They accept same number of words

Two FAs represent same languages over some alphabet (may or may not be same for FAs), If

Question No. 6 Marks : 02

Identify the language accepted by the following PDA. Build an FA accepting the corresponding language. Write the corresponding RE as well.

Question No. 5 Marks : 10

2nai. Square ( , for n = 1, 2, 3, ….)

(b) Use Pumping Lemma II to show that following language is non-regular. (5)

Page 12: Cs402 Collection of Old Papers

o All strings of a's in Σ = {a,.b} o Φ

Λ oo (a+b)*

A Language that is finite but not regular

Question No. 9 Marks : 02

ii. All the words that have exactly two or three b's. i. All the words that do not contain substring abb.

(b) Find Context Free Grammar's (CFG's) for the following languages over the Σ={a, b}. (4)

iii. Unit Production ii. Ambiguous CFG. i. Total language tree (TLT)

a) Define the following terms (6)

Page 13: Cs402 Collection of Old Papers

WWW.vujannat.ning.Com Connecting VU Students

truct RE’s for following languages over Σ= {a, b}

Question No. 5

2. Fal1. True

Question No. 4

2. False 1. True

Question No. 3

i-word is

Question No. 2 Marks : 3

2. False 1.

Question No. 1 Marks : 1

Final Term Examination – Spring 2006 Time Allowed: 150 Minutes

A production of the form non-terminal non-terminal is called a dead Production.

True

Sem a string having some terminals and one non-terminal at the right of string.

1. True 2. False

Marks : 3

Two FAs are equivalent if they have same no. of states.

Marks : 1

There exist exactly two different derivations in an ambiguous CFG for a word.

se

Marks : 1 Cons

i. All words which contain substring “baba”. [5]

CS402

Page 14: Cs402 Collection of Old Papers

Q

uestion No. 9 Marks : 1

PDA is stronger than FA.

3. True 4. False

uestion No. 10 Marks : 3

Q

Question No. 8

1. True 2. False

C

Question No. 7

. True 2. False 1

Q

Aii. ll words which never end in substrings “aa” and “ab” [5]

uestion No. 6 Marks : 1

Regular languages are closed under Union, Concatenation and Kleene star.

Marks : 1

FG may also represent a regular language.

Marks : 1

Find the complement of the FA below,

Page 15: Cs402 Collection of Old Papers

AcB →abaA→

ABaS

What is language accepted by above FA?

Question No. 14 False

rueT There Question No. 13

2. False

Question No. 12

S → S + T | T

Remove Unit p

en CFG below, Question No. 11 False

Union of two

FAs is an FA that accepts all the string of FA1 and FA2. True

Marks : 3

Giv a

a) roductions from the CFG. [5]

T → T * F | F F → ( S ) | a

b) Derive CNF corresponding to the CFG given below. [10]

Marks : 10

In non-deterministic PDA a string may be traced by more than one paths.

1. True

Marks : 1

always exist an FA for each PDA.

Marks : 1

a) Given an FA below, [5]

Page 16: Cs402 Collection of Old Papers

b) Draw a non-deterministic PDA for the above FA. [10]

Page 17: Cs402 Collection of Old Papers

WWW.vujannat.ning.comhttp://vujannat.ning.com

Largest Online Community of VU Students FINALTERM EXAMINATION

SPRING 2007

CS402 - THEORY OF AUTOMATA (Session - 5 )

Marks: 55

Time: 120min

StudentID/LoginID: ______________________________

Student Name: ______________________________

Center Name/Code: ______________________________

Exam Date: Saturday, July 07, 2007

1. This examination is closed book, closed notes, closed neighbors.

2. Answer all questions.

a. There is no choice.

b. You will have to answer correctly all questions in this examination to get the maximum possible marks.

3. Do not ask any questions about the contents of this examination from anyone.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

4. Use of cell phone during the examination is strictly prohibited, otherwise strict disciplinary action will be taken as per university rules

5. You are allowed to use only MS Word for drawing Diagrams and Symbols.

**WARNING: Please note that Virtual University takes serious note of unfair means. Anyone found involved in cheating will get an `F` grade in this course.

For Teacher's use only Question 1 2 3 4 5 6 7 8 9 10 Total

Marks Question 11 12 13 14 15

Marks Question

Marks

Page 18: Cs402 Collection of Old Papers

Question No: 1 ( Marks: 1 ) - Please choose one PDA is only used to represent a regular language. ►

True

False

Question No: 2 ( Marks: 1 ) - Please choose one If L is a regular language then LC is also a regular language. ►

True

False

Question No: 3 ( Marks: 1 ) - Please choose one A production of the form non-terminal string of two non-terminal is called a live Production. ►

True

False

Question No: 4 ( Marks: 1 ) - Please choose one we can find a CFG corresponding to a DFA. ►

True

False

Question No: 5 ( Marks: 1 ) - Please choose one START, READ, HERE and ACCEPTS are conversions of the machine ►

True

False

Question No: 6 ( Marks: 1 ) - Please choose one A CFG is said to be ambiguous if there exists at least one word of its language that can be generated by different production trees ►

True

False

Question No: 7 ( Marks: 1 ) - Please choose one

Page 19: Cs402 Collection of Old Papers

Syntax tree or Generation tree or Derivation tree are same tree ►

True

False

Question No: 8 ( Marks: 1 ) - Please choose one The symbols that cannot be replaced by anything are called terminals ►

True

False

Question No: 9 ( Marks: 1 ) - Please choose one The production of the form non-terminal one non-terminal is called unit production ►

True

False

Question No: 10 ( Marks: 1 ) - Please choose one DFA and PDA are equal in power. ►

True

False

Question No: 11 ( Marks: 10 ) a) Define Describe the following terms: [Note: maximum in 20 to 30 words for each] I. CNF II. Regular Grammar b) Convert the following CFG into CNF S → CDCD C → 0|Λ D → 1|Λ Question No: 12 ( Marks: 10 )

a) Construct RE’s for following languages over Σ= {0, 1} (6) i. All words in which “1” never follows “0”. ( “0” never appears before “1”) ii. All words which begin and end with different letters.

b) How many minimum states can be there in an NFA of language having all word

with “101” at the end? (4)

Page 20: Cs402 Collection of Old Papers

HINT: Build NFA for language for yourself but write only number of minimum states. No need to build NFA in software. Question No: 13 ( Marks: 10 ) a) Is this an FA or NFA? (2)

b) Determine the CFG corresponding to the above FA or NFA (8) Question No: 14 ( Marks: 10 ) a) Given CFG (Context Free Grammar): (6)

S → bS | aX | Λ X → aX | bY | Λ Y → aX | Λ

Derive following strings from above CFG. Show all steps. If string cannot be derived then describe it.

i. baabab ii. ababaab

b) Describe language of following PDA (Push Down Automata): (4) [ Note: Don’t write more than two to three lines for each. Only write to the point. ]

Page 21: Cs402 Collection of Old Papers

0

READREADREAD

1

1

1

0

0

ACCEPT

START

REJECT

Question No: 15 ( Marks: 5 ) Given a CFG below, [5] S → bS | aM M→ bM | aF F → bF | aM | ^ What is language accepted by above CFG?

Page 22: Cs402 Collection of Old Papers

www.vujannat.ning.com

Question No. 2 Marks : 10

False True

If s=abcd is a string defined over ∑ = {a,bc,d} then reverse of s is dcba. Question No. 1 Marks : 1

**WARNING: Please note that Virtual University takes serious note of unfair means. Anyone found involved in cheating will get an `F` grade in

this course.

4. You are allowed to use any Software for Diagrams and Symbols like MS Word, MathType and Visio etc.

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

3. Do not ask any questions about the contents of this examination from anyone.

b. You will have to answer correctly all questions in this examination to get the maximum possible marks.

a. There is no choice.

2. Answer all questions.

1. This examination is closed book, closed notes, closed neighbors.

Please read the following instructions carefully before attempting any question:

Time Allowed: 90 Minutes

Mid Term Examination – Spring 2006 CS402 Theory of Automata

Page 23: Cs402 Collection of Old Papers

}, n=1,2,3,… , of strings defined over Σ={a, b} 4n b2n L = Defining the language {a a) Write the recursive definition of the following language. [6] Question No. 7 Marks : 10

False True

A regular language can not be infinite. Question No. 6 Marks : 1

False True

There can be more than one start states in TG. Question No. 5 Marks : 1

False True

Every NFA can be converted into FA. Question No. 4 Marks : 1

False True

∑ = {aa, b}, length(aaaabaabb) = 5. Question No. 3 Marks : 1

[Hint: use FA to GTG and GTG to RE.] Find the regular expression associated to the following FA. Show all steps.

Page 24: Cs402 Collection of Old Papers

? + = a*aa Question No. 12 Marks : 1

False True

Recursive method for defining language is only for regular languages. Question No. 11 Marks : 1

False True

If a regular language is empty then we denote it like L = Ǿ (fi). Question No. 10 Marks : 1

b) Draw DFA for the following NFA. [6] a) Define NFA-null. [4] Question No. 9 Marks : 10

False True

Kleene star of {1} generates {1, 11, 111, 1111, 11111 ……}. Question No. 8 Marks : 1

b) Write a regular expression of the language having strings that either start or end with “00” and have no more zeroes. Where the alphabet is {0, 1}. [4]

Page 25: Cs402 Collection of Old Papers

False True

The language equal means number of a’s and b’s are equal with null string. Question No. 13 Marks : 1

False True

Page 26: Cs402 Collection of Old Papers

WWW.vujannat.ning.comhttp://vujannat.ning.com

Largest Online Community of VU Students MIDTERM EXAMINATION

SPRING 2007

CS402 - THEORY OF AUTOMATA (Session - 4 )

Marks: 35

Time: 90min

StudentID/LoginID: ______________________________

Student Name: ______________________________

Center Name/Code: ______________________________

Exam Date: Saturday, April 28, 2007

1. This examination is closed book, closed notes, closed neighbors.

2. Answer all questions.

a. There is no choice.

b. You will have to answer correctly all questions in this examination to get the maximum possible marks.

3. Do not ask any questions about the contents of this examination from anyone.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your understanding.

b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to solve the problem.

You are allowed to use only MS Word for drawing Diagrams and Symbols.

**WARNING: Please note that Virtual University takes serious note of unfair means. Anyone found involved in cheating will get an `F` grade in this course.

For Teacher's use only Question 1 2 3 4 5 6 7 8 9 10 Total

Marks Question 11 12 13 14 15 16 17 18

Marks Question

Marks Question No: 1 ( Marks: 1 ) - Please choose one

Page 27: Cs402 Collection of Old Papers

Length of a null string is supposed to be 1. ►

True

False

Question No: 2 ( Marks: 1 ) - Please choose one There is no difference between Word and String ►

True

False

Question No: 3 ( Marks: 1 ) - Please choose one There may be two RE representing the same language. ►

True

False

Question No: 4 ( Marks: 1 ) - Please choose one NFA – null can be considered as TG and vise versa. ►

True

False

Question No: 5 ( Marks: 1 ) - Please choose one ∑ = {aA, b}, length(aAbaAaAb) = 5. ►

True

False

Question No: 6 ( Marks: 1 ) - Please choose one If s=abcd is a string defined over ∑ = {a,b,c,d} then reverse of s is dcba. ►

True

False

Question No: 7 ( Marks: 1 ) - Please choose one

Page 28: Cs402 Collection of Old Papers

The language equal means number of a’s and b’s are equal with no null string. ►

True

False

Question No: 8 ( Marks: 1 ) - Please choose one Palindrome is a regular language. ►

True

False

Question No: 9 ( Marks: 1 ) - Please choose one If s = babab then palindrome of s = rev(s). ►

True

False

Question No: 10 ( Marks: 1 ) - Please choose one TG must have only one start state. ►

True

False

Question No: 11 ( Marks: 1 ) - Please choose one If a language can be accepted by FA then it can be accepted by a TG as well. ►

True

False

Question No: 12 ( Marks: 1 ) - Please choose one Length of output string is 1 less then that of input string is mealy machine. ►

True

False

Question No: 13 ( Marks: 1 ) - Please choose one Formal languages are called Semantic languages.

Page 29: Cs402 Collection of Old Papers

True

False

Question No: 14 ( Marks: 1 ) - Please choose one Every NFA can be converted to an FA ►

True

False

Question No: 15 ( Marks: 1 ) - Please choose one In mealy machine output character are mentioned on the transition. ►

True

False

Question No: 16 ( Marks: 8 ) Differentiate between the following terms:

• Mealy and Moore machine. • NFA and FA.

Question No: 17 ( Marks: 5 ) Build an FA corresponding to NFA given below.

b

b

a

+q3

q1

q0

Question No: 18 ( Marks: 7 ) Build an NFA equivalent to FA1U FA2, where FA1, FA2 are given below. FA1

a,b a

b

a b

p- + q

Page 30: Cs402 Collection of Old Papers

FA2

a

1–

3

6+

2

3

4

5

a

a a,b

b

b

b

a b

b

a