Professional Documents
Culture Documents
Page 1 of 4
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
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
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
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.
(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)
a b
b
A C+
a a
S– b
a a
b
B D+
b
o Stack
o Tape
o Head
o Word
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, ….)
Identify the language accepted by the following PDA. Build an FA accepting the
corresponding language. Write the corresponding RE as well.
Two FAs represent same languages over some alphabet (may or may not be same for
FAs), If
o b*aa
o aab*
o b*aab*
o b*(aa)*b*
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
Semi-word is a string having some terminals and one non-terminal at the right of string.
1. True
2. False
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
Regular languages are closed under Union, Concatenation and Kleene star.
1. True
2. False
Question No. 7 Marks : 1
1. True
2. False
Question No. 8 Marks : 1
S→S+T|T
T→T*F|F
F→(S)|a
S → ABa
A → aab
B→
Question No. 12 Ac Marks : 10
1. True
2. False
Question No. 13 Marks : 1
True
False
StudentID/LoginID: ______________________________
a. There is no choice.
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.
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.
► True
► False
► True
► False
► True
► False
► True
► False
► True
► False
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
► True
► False
► True
► False
The production of the form non-terminal Æ one non-terminal is called unit production
► True
► False
► True
► False
I. CNF
II. Regular Grammar
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.
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
S → bS | aM
M→ bM | aF
F → bF | aM | ^
True
False
True
False
Question No. 4 Marks : 1
True
False
True
False
True
False
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]
Kleene star of {1} generates {1, 11, 111, 1111, 11111 ……}.
True
False
True
False
True
False
aa* = a+ ?
True
False
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: ______________________________
a. There is no choice.
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.
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.
► True
► False
► True
► False
► True
► False
► True
► False
► True
► False
► True
► False
► True
► False
► True
► False
► True
► False
► True
► False
► True
► False
Length of output string is 1 less then that of input string is mealy machine.
► True
► False
► False
► True
► False
► True
► False
q1 b
a
b
q0 +q3
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