Sunteți pe pagina 1din 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
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
Connecting VU Students
Page 3 of 4

Q No. 8
Determine the CFG, corresponding to the following FA (5)

a b
b
A C+
a a
S– b
a a
b
B D+
b

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
+
a b
– a
b b
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)
Connecting VU Students
Page 4 of 4
q1 b/1 q2

a/0 a/1 b/1 a/0

q0 b/0 q3 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)
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
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)
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 0
0,1

- 0 1 +

1
1

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)

a
a

q0/0 b b a
q1/0 q2/0 q3/1
a
b
b
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)
www.vujannat.ning.com

CS402 Theory of Automata


Final Term Examination – Spring 2005
Time Allowed: 150 Minutes

Instructions
Please read the following instructions carefully before attempting any question:
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. You are allowed to use any Software for Diagrams and Symbols like MS
Word, MathType and Visio etc.

**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.

Total Marks: 50 Total Questions: 09

Question No. 1 Marks : 02

A Total Language Tree has

o All languages over Σ


o All strings over Σ
o All words of all languages over Σ
o All words of one language over Σ
Question No. 2 Marks : 10

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

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

a b
b
A C+
a a
S– b
a a
b
B D+
b

Question No. 3 Marks : 02

What Turing Machine does not have?

o Stack
o Tape
o Head
o Word

Question No. 4 Marks : 10

(a) Draw Moore Machine equivalent to following Mealy Machine. (5)

q1 1/1
1/0

0/0
q0 0/1 q3 1/0

0/0 1/0
q2

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

n2
i. Square ( a , for n = 1, 2, 3, ….)

Question No. 5 Marks : 10

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

Question No. 6 Marks : 02

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

o They accept same words


o They accept same number of words
o They reject same words
o None of above

Question No. 7 Marks : 02

CFG given S Æ bS|Sb|aa represents language

o b*aa
o aab*
o b*aab*
o b*(aa)*b*

Question No. 8 Marks : 10


a) Define the following terms
(6)
i. Total language tree (TLT)
ii. Ambiguous CFG.
iii. Unit Production
(b) Find Context Free Grammar's (CFG's) for the following languages over the Σ={a, b}.
(4)
i. All the words that do not contain substring abb.
ii. All the words that have exactly two or three b's.

Question No. 9 Marks : 02

A Language that is finite but not regular

o Λ
o (a+b)*
o Φ
o All strings of a's in Σ = {a,.b}
WWW.vujannat.ning.Com
Connecting VU Students

CS402
Final Term Examination – Spring 2006
Time Allowed: 150 Minutes

Question No. 1 Marks : 1

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


1. True
2. False

Question No. 2 Marks : 3

Semi-word is a string having some terminals and one non-terminal at the right of string.
1. True
2. False

Question No. 3 Marks : 3

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

1. True
2. False
Question No. 4 Marks : 1

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

1. True
2. False
Question No. 5 Marks : 1

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

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


ii. All words which never end in substrings “aa” and “ab” [5]

Question No. 6 Marks : 1

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

1. True
2. False
Question No. 7 Marks : 1

CFG may also represent a regular language.

1. True
2. False
Question No. 8 Marks : 1

Find the complement of the FA below,

Question No. 9 Marks : 1

PDA is stronger than FA.


3. True
4. False

Question No. 10 Marks : 3


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

Question No. 11 Marks : 3

Given a CFG below,

a) Remove Unit productions from the CFG. [5]

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

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

S → ABa
A → aab
B→
Question No. 12 Ac Marks : 10

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

1. True
2. False
Question No. 13 Marks : 1

There always exist an FA for each PDA.

True
False

Question No. 14 Marks : 1

a) Given an FA below, [5]

What is language accepted by above FA?


b) Draw a non-deterministic PDA for the above FA. [10]
WWW.vujannat.ning.com
http://vujannat.ning.com
Largest Online Community of VU Students
FINALTERM EXAMINATION
SPRING 2007 Marks: 55
CS402 - THEORY OF AUTOMATA (Session - 5 ) 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
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


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)
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. ]
START 1

READ
0
READ READ
1

REJECT
ACCEPT

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?


www.vujannat.ning.com

CS402 Theory of Automata


Mid Term Examination – Spring 2006
Time Allowed: 90 Minutes

Please read the following instructions carefully before attempting any


question:

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. You are allowed to use any Software for Diagrams and Symbols
like MS Word, MathType and Visio etc.
**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.

Question No. 1 Marks : 1

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

 True
 False

Question No. 2 Marks : 10


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

Question No. 3 Marks : 1

∑ = {aa, b}, length(aaaabaabb) = 5.

 True
 False
Question No. 4 Marks : 1

Every NFA can be converted into FA.

 True
 False

Question No. 5 Marks : 1

There can be more than one start states in TG.

 True
 False

Question No. 6 Marks : 1

A regular language can not be infinite.

 True
 False

Question No. 7 Marks : 10

a) Write the recursive definition of the following language. [6]

L = Defining the language {a2n b4n }, n=1,2,3,… , of strings defined over Σ={a, b}
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]

Question No. 8 Marks : 1

Kleene star of {1} generates {1, 11, 111, 1111, 11111 ……}.

 True
 False

Question No. 9 Marks : 10

a) Define NFA-null. [4]

b) Draw DFA for the following NFA. [6]

Question No. 10 Marks : 1


If a regular language is empty then we denote it like L = Ǿ (fi).

 True
 False

Question No. 11 Marks : 1

Recursive method for defining language is only for regular languages.

 True
 False

Question No. 12 Marks : 1

aa* = a+ ?
 True
 False

Question No. 13 Marks : 1

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

 True
 False
WWW.vujannat.ning.com
http://vujannat.ning.com
Largest Online Community of VU Students

MIDTERM EXAMINATION
SPRING 2007 Marks: 35
CS402 - THEORY OF AUTOMATA (Session - 4 ) 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


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


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.


► 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.

q1 b
a

b
q0 +q3

Question No: 18 ( Marks: 7 )

Build an NFA equivalent to FA1U FA2, where FA1, FA2 are given below.

FA1
b a,b
a
p- q a
+
b
FA2

2 a
4

a a
b a,b

1– a b 6+

b a b

3 b 5
3

S-ar putea să vă placă și