0% found this document useful (0 votes)
839 views

Collective PDF

The document contains a set of multiple choice questions about the theory of automata. It covers topics like: - Regular expressions and languages - Finite automata and transition graphs - Context-free grammars and parsing - Turing machines - Properties of regular and non-regular languages The questions test understanding of concepts like regularity and non-regularity of languages, pumping lemma, Chomsky normal form, and relationships between different models of computation like finite automata, pushdown automata and Turing machines.

Uploaded by

Abdul Wahab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
839 views

Collective PDF

The document contains a set of multiple choice questions about the theory of automata. It covers topics like: - Regular expressions and languages - Finite automata and transition graphs - Context-free grammars and parsing - Turing machines - Properties of regular and non-regular languages The questions test understanding of concepts like regularity and non-regularity of languages, pumping lemma, Chomsky normal form, and relationships between different models of computation like finite automata, pushdown automata and Turing machines.

Uploaded by

Abdul Wahab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 183

CS402- Theory of Automata

Solved MCQS Feb 22,2013


From Final term Papers
MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01

FINALTERM EXAMINATION
Fall 2012
CS402- Theory of Automata
Question No: 1 ( Marks: 1 ) - Please choose one
If Σ = {aa, bb} , then Σ* will not contain
►aaabbb
►aabbbb
►aabbaa
►bbaabbbb

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


Below given FA has __________ RE.

►a(a+b)* (Page 14)


► (a(a+b)*)*
►a(a+b)*a
►a(a+b)*a + b(a+b)*b

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


“One language can have _________ TG‟s”.
►Only one
►Only two
►More than one
►Only three

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

Above given TG represents the language i.e.


►EVEN-EVEN (Page 22)
►PALINDROME
►FACTORIAL
►None of these

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


According to 1st part of the Kleene‟s theorem, If a language can be accepted by an FA then it can be accepted
by a ________ as well.
►FA
►CFG
►GTG
►TG (Page 25)

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


Even-palindrome is a _______ language.
►Non-regular click here for detail
►Regular
►Regular but infinite
►Regular but finite

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


If L is a regular language then, Lc is also a _____ language.
► Regular (Page 66)
► Non-regular
► Regular but finite
► None of the given

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


Pumping lemma is generally used to prove that:
► A given language is infinite
► A given language is not regular Click here for detail
► Whether two given regular expressions of a regular language are equivalent or not
► None of these

2
Question No: 9 ( Marks: 1 ) - Please choose one
If the FA has N states, then test the words of length less than N. If no word is accepted by this FA, then it will
_________ word/words.

►accept all
►accept no (Page 85)
►accept some
►reject no

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


In CFG, the symbols that can‟t be replaced by anything are called________.

► Terminal (Page 87)


► Non-Terminal
► Production
► All of given

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


Which of the following is a regular language?

► String of odd number of zeroes Click here for detail


► Set of all palindromes made up of 0‟s and 1‟s
► String of 0‟s whose length is a prime number
► All of these

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


Which of the following pairs of regular expressions are equivalent?

►1(001)* and (10)*10


►x(xx)* and (x)*x
► X  and X*
► X  and X* X 

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


An alphabet of Σ is valid if

►No letter of Σ appears in middle of any other letter


►No letter of Σ appears at end of any other letter
►No letter of Σ appears at start of any other letter (Page 4)
►No letter of Σ appears at end or middle of any other letter

3
Question No: 14 ( Marks: 1 ) - Please choose one
Which of the following statement is true

►The length of the output string is greater than length of input string in moore machine. Click here for detail
►The length of the output string is greater than length of input string in mealy machine.
►The length of the output string is equal to length of input string in moore machine.
►The length of the output string is less than length of input string in mealy machine.

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


If a CFG has only productions of the form
nonterminal → string of two nonterminals
or
nonterminal → one terminal
then the CFG is said to be in ________

►Chomsky Normal Form (Page 101)


►Ambiguous Form
►Left Aligned Form
►Right Aligned Form

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


We can also represent an FA using different states e.g Accept state; Reject state, Read state etc.
The ________ state behaves as final state of an FA
►Accept (Page 105)
►Pop
►Push
►Reject

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


where the input string is placed before it is run, is called _______
►Date tape
►Input Tape (Page 105)
►Output Tape
►Magnetic tape

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


An FSM can be considered as TM

►Of finite tape length, rewinding capability and unidirectional tape movement
►Of finite tape length, without rewinding capability and bidirectional tape movement
►Of finite tape length, rewinding capability and bidirectional tape movement
►Of finite tape length, without rewinding capability and unidirectional tape movement click here for
detail

4
Question No: 19 ( Marks: 1 ) - Please choose one
The process of finding the derivation of the word generated by particular grammar is called _____

►Processing
►Parsing (Page 136)
►Programming
►Planning

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


The first rule of converting the given “CFG in CNF”, is _______

►CNK algorithm
►CYK algorithm (Page 135) Algorithm 4 (The CYK algorithm)
►CKY algorithm
►KYC algorithm

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


Consider the following TM

►Above TM accepts the non-CFL {a b c}


►Above TM accepts the non-CFL {a n b n a n } (Page 142)
►Above TM accepts the non-CFL {a n b n  2 a n }

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


Alphabet Σ = {a, bc, cc} has number of letters

►One
►Two
►Three
►Four

5
Question No: 23 ( Marks: 1 ) - Please choose one
If r1 is a regular expression then r1* is a ______
►GTG
►NFA
►FA
►RE (Page 9)

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

(a)

(b)

► (a) is FA, (b) is NFA (Page 43)


► (a) is NFA, (b) is FA
► (a) is TG, (b) is FA
► (a) is TG, (b) is GTG

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


We cannot write regular expressions for all _______.

►FA‟s
►TG‟s
►NFA‟s
►CFG’s (Page 97)

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


For every Context Free Grammar (CFG), we can make the corresponding ______.

►FA
►TG
►PDA click here for detail
►Regular Grammar

6
Question No: 27 ( Marks: 1 ) - Please choose one
Pumping Lemma II says that length(x) + length(y) should be ______.

►Less than number of states (Page 75)


►Equal to number of states
►Greater than number of states
►Greater than or equal to number of states

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


Chomsky normal form (CYK) algorithm was proposed by ______.

►John cock (Page 135)


►James Cock
►Daniel I.A.
►John Weiss

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

The above machine is a/anTG ___________

► Finite Automata
► Turing machine (Page 141)
► FA
► TG

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


The language of Palindromes defined over an alphabet set {a, b} can be recognized by ______.

►FA
►NFA
►TG
►PDA (Page 91)
Hint: - as it is non-regular so its CFG and PDA are possible.

7
Question No: 31 ( Marks: 1 ) - Please choose one
Which of the following statement(s) is/are true or false?
(1)The Turing Machine is similar to a finite automation but with an unlimited and unrestricted memory.
(2) A Turing machine much more accurate model of a general purpose computer.

►Statement 1 is true Click here for detail


►Statement 2 is true Click here for detail
►Both statements (1 & 2) are false
►Statements 2 is false

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


Which of the following is the first phase of compiler on the basis of functionality?

►Parser
►Lexical analyzer
►Scanner Click here for detail
►Interpreter
Hint: - The first phase of a compiler is called lexical analysis (and is also known as a lexical scanner).

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


(Σ* - L) represent the _______ of a language L.

►Complement (Page 66)


►Kleene‟s closure
►Union
►intersection

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


If we have two transition graphs then their union will be expressed by
►taking a common start state and joining them by two null transitions (Page 65)
►just connecting both start states by null transitions
►connecting final state of first TG to the initial state of second TG
►connecting the final state of first TG to the final state of second TG

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


______ and _______ are removed in order to make a CFG in Chomsky Normal Form(CNF).

►Null, nullable productions


►Nullable , unit productions
►Null, unit productions (Page 102)
►String of length 0, null

8
Question No: 36 ( Marks: 1 ) - Please choose one
If L1 and L2 are expressed by regular languages then L1 + L2 is also a_________ Language.
► Regular (Page 10)
► Ir-regular
► PDA
► Hybrid

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


Which of the following is a regular Context Free Grammar:

►S → abS| baS | ^ ab(ab+ba)*ba + ba(ab+ba)*ab
►S → aSb| baS | ^
►S → abS| bSa | ^
►S → aSb| Sa | ^
Hint :- remaining represents palindromes language which is non-regular

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


A read state can have _______ outgoing edge/ edges.

►1
►2
►3
►Any number of (Page 111)

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


Finite Automation (FA) and Nondeterministic Finite Automation (NFA) are equivalent if

►FA and NFA accept the same language (Page 43) Also click here for detail
►FA shape is same like an NFA
►FA accept the null string also
►NFA accept the null string also

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


________ is always Deterministic.

►Finite Automation (Page 25)


►Transition Graph
►Generalize Transition Graph
►Non-deterministic finite automation

9
FINALTERM EXAMINATION
Spring 2010
CS402- Theory of Automata (Session - 1)

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


If r1 = (aa + bb) and r2 = ( a + b) then the language (aa + bb)(a + b) will be generated by

► (r1)(r2) (Page 10)


► (r1 + r2)
► (r2)(r1)
► (r1)*

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


“One language can be expressed by more than one FA”. This statement is ______
► True (Page 14)
► False
► Some times true & sometimes false
► None of these

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


Who did not invent the Turing machine?
► Alan Turing
► A. M. Turing (Page 140)
► Turing
► None of these

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


Which statement is true?
► The tape of turing machine is infinite. (Page 140)
► The tape of turing machine is finite.
► The tape of turing machine is infinite when the language is regular
► The tape of turing machine is finite when the language is nonregular.

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


A regular language:
► Must be finite (Page 11)
► Must be infinite
► Can be finite or infinite
► Must be finite and cannot be infinite

10
Question No: 6 ( Marks: 1 ) - Please choose one
Every regular expression can be expressed as CFG but every CFG cannot be expressed as a regular expression.
This statement is:

► Depends on the language


► None of the given options
► True (Page 97)
► False

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


a b b

X1– X2+

a
Above given FA corresponds RE r. then FA corresponding to r* will be
z1±

b a

b a

z3+ z2 a

b
This statement is

► True (Page 38)


► False
► Depends on language
► None of these

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


Consider the language L of strings, defined over Σ = {a,b}, ending in a

► There are finite many classes generated by L, so L is regular (Page 76)


► There are infinite many classes generated by L, so L is regular
► There are finite many classes generated by L, so L is non-regular
► There are infinite many classes generated by L, so L is non-regular

11
Question No: 9 ( Marks: 1 ) - Please choose one
aa,bb aa,bb
ab,ba


ab,ba
Above given TG has _____________ RE.

► (aa+aa+(ab+ab)(aa+ab)*(ab+ba))*
► (aa+bb+(ab+ba)(aa+bb)*(ab+ba))* (Page 22)
► (aa+bb+(ab+ba)(aa+bb)(ab+ba))*
► None of these

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


The word „formal‟ in formal languages means

► The symbols used have well defined meaning


► They are unnecessary, in reality
► Only the form of the string of symbols is significant Click here for detail
► None of these

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


Let A = {0, 1}. The number of possible strings of length „n‟ that can be formed by the elements of the set A is

► n!
► n2
► nm
► 2n

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


Choose the correct statement.
► A Mealy machine generates no language as such
► A Moore machine generates no language as such
► A Mealy machine has no terminal state
► All of these click here for detail

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


TM is more powerful than FSM because
► The tape movement is confined to one direction
► It has no finite state control
► It has the capability to remember arbitrary long sequences of input symbols Click here for detail
► None of these

12
Question No: 14 ( Marks: 1 ) - Please choose one
If L1 and L2 are expressed by regular expressions r1 and r2, respectively then the language expressed by r1 +
r2 will be _________
► Regular (Page 10)
► Ir-regular
► Can‟t be decided
► Another Language which is not listed here

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


Like TG, a PDA can also be non-deterministic
► True (Page 111)
► False

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

The above machine is a/an ___________


► Finite Automata
► Turing machine (Page 141) rep
► FA
► TG

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


The language of all words (made up of a‟s and b‟s) with at least two a‟s can not be described by the regular
expression.
► a(a+b)*a(a+b)*(a+b)*ab*
► (a+b)* ab* a(a+b)*
► b*ab* a(a+b)*
► none of these
n n
a b {where n>0} is the language will at least one a and b and cannot be described by RE.

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


In FA, if one enters in a specific state but there is no way to leave it, then that specific state is called
► Dead State
► Waste Basket
► Davey John Locker
► All of these (Page 17)

13
Question No: 19 ( Marks: 1 ) - Please choose one
If L is a regular language then, Lc is also a _____ language.
► Regular (Page 66) rep
► Non-regular
► Regular but finite
► None of the given

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


In CFG, the symbols that can‟t be replaced by anything are called___
► Terminal (Page 87) rep
► Non-Terminal
► Production
► All of given

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


Which of the following is NOT a regular language?
► String of 0‟s whose length is a perfect squere
► Set of all palindromes made up of 0‟s and 1‟s
► String of 0‟s whose length is a prime number
► All of the given options Click here for detail

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


Choose the incorrect (FALSE) statement.
► A Mealy machine generates no language as such
► A Mealy machine has no terminal state
► For a given input string, length of the output string generated by a Moore machine is not more
than the length of the output string generated by that of a Mealy machine click here for detail
► All of these

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


Pumping lemma is generally used to prove that:
► A given language is infinite
► A given language is not regular Click here for detail rep
► Whether two given regular expressions of a regular language are equivalent or not
► None of these

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


Which of the following is a regular language?

► String of odd number of zeroes Click here for detail rep


► Set of all palindromes made up of 0‟s and 1‟s
► String of 0‟s whose length is a prime number
► All of these

14
Question No: 25 ( Marks: 1 ) - Please choose one
Choose the incorrect statement:
► (a+b)*aa(a+b)* generates Regular language.
► A language consisting of all strings over ∑={a,b} having equal number of a’s and b’s is a regular
language
► Every language that can be expressed by FA can also be expressed by RE
► None of these

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


Left hand side of a production in CFG consists of:
► One terminal
► More than one terminal
► One non-terminal (Page 87)
► Terminals and non-terminals

FINALTERM EXAMINATION
SPRING 2007

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


PDA is only used to represent a regular language.
► True
► False Click here for detail

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


If L is a regular language then LC is also a regular language.
► True (Page 66) rep
► 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 (Page 127)
► False

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


We can find a CFG corresponding to a DFA.
► True (Page 97)
► False

15
Question No: 5 ( Marks: 1 ) - Please choose one
START, READ, HERE and ACCEPTS are conversions of the machine
► True (Page 122)
► 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 (Page 95)
► False

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


Syntax tree or Generation tree or Derivation tree are same tree
► True (Page 92)
► False

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


The symbols that cannot be replaced by anything are called terminals
► True (Page 87) rep
► False

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


The production of the form non-terminal  one non-terminal is called unit production
► True (Page 100)
► False

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


DFA and PDA are equal in power.
► True
► False (Page 105)

FINALTERM EXAMINATION
Spring 2006
CS402- Theory of Automata

Question No. 1
A production of the form non-terminal  non-terminal is called a dead Production.
True
False (Page 127)

16
Question No. 2
Semi-word is a string having some terminals and one non-terminal at the right of string.
True (Page 97)
False

Question No. 3
Two FAs are equivalent if they have same no. of states.
True (Page 15)
False

Question No. 4
There exist exactly two different derivations in an ambiguous CFG for a word.
True (Page 93)
False

Question No. 6
Regular languages are closed under Union, Concatenation and Kleene star.
True (Page 10)
False

Question No. 7
CFG may also represent a regular language.
True (Page 97)
False

Question No. 9 Marks : 1


PDA is stronger than FA.
True (Page 105)
False

FINALTERM EXAMINATION
Spring 2005
CS402- Theory of Automata

Question No. 1
A Total Language Tree has
All languages over Σ
All strings over Σ (Page 96)
All words of all languages over Σ
All words of one language over Σ

17
Question No. 2
What Turing Machine does not have?
Stack
Tape
Head
Word
Turing machine has stack but insertion and deletion can be done from both sides. Tape and head to.

Question No. 3
CFG given S  bS|Sb|aa represents language
b*aa
aab*
b*aab*
b*(aa)*b*

Question No. 4
A Language that is finite but not regular
Λ
(a+b)*
Φ (not sure)
All strings of a's in Σ = {a,.b}

18
CS402 – Quiz No.3
Question # 1 of 10 (Total Marks: 1) Select correct option:
The values of input (say a & b) does not remain same in one cycle due to
NAND gate
Click plus
OR gate
NOT gate

Question # 2 of 10 (Total Marks: 1) Select correct option:


Set of all palindromes over {a,b}is regular

True
False (Page 74)

Question # 3 of 10 (Total Marks: 1) Select correct option:


In CFG, the symbols that cannot be replaced by anything are called

Terminals (Page 87) rep


Non terminals
Productions
None of the given options

Question # 4 of 10 (Total Marks: 1) Select correct option:


a^n b^n generates the ………… language

regular
non regular
EQUAL and non regular (Page 71)
EQUAL and regular

Question # 5 of 10 (Total Marks: 1) Select correct option:


The grammatical rules which involves meaning of words are called:

Semantic (Page 87)


Sytactics
Alphabets
None of the given options

19
Question # 6 of 10 (Total Marks: 1) Select correct option:
The reverse of the string sbfsbb over { sb, f, b }

bbsfbs
bsbfsb
sbbfsb
bsfbsb

Question # 7 of 10 (Total Marks: 1) Select correct option:


If an FA has N state then it must accept the word of length

N-1
N+1
N+2N

Question # 8 of 10 (Total Marks: 1) Select correct option:


Two languages are said to belong to same class if they end in the same state when they run over an FA, that
state

Must be final state


May be final state or not (Page 75)
May be start or not
None of the given options

Question # 9 of 10 (Total Marks: 1) Select correct option:


In pref(Q in R) Q is …… to (than) R

Equal
Not Equal (Page 79)
Greater
Smaller

Question # 10 of 10 (Total Marks: 1) Select correct option:


According to Myhill Nerode theorem, if L generates finite no. of classes then L is.......

Finite
Infinite
Regular (Page 76)
Non Regular

20
Question # 1 of 10 (Total Marks: 1) Select correct option:
If the intersection of two regular languages is regular then the complement of the intersection of these two
languages is also regular

True (Page 68)


False

Question # 2 of 10 (Total Marks: 1) Select correct option:


In pumping lemma theorem (x y^n z) the range of n is

n=1,2,3,4..... (Page 74)


n=0,1,2,3,4....
n=-3,-2,-1,0,1,2,3,4.....
n=-3,-2,-1,1,2,3,4.....

Question # 3 of 10 (Total Marks: 1) Select correct option:


The complement of a regular language is also a regular

True rep
False

CS402 – Quiz No.3


Question # 1 of 10 (Total Marks: 1) Select correct option:
For a non regular language there exist …… FA

One
At least one
At most one
No (Page 71)

Question # 2 of 10 (Total Marks: 1) Select correct option:


The strings or words which do not belong to a language is called…………. of that language

Intersection
Union
Complement (Page 66)
Quotient

21
Question # 3 of 10 (Total Marks: 1) Select correct option:
A non regular language can be represented by
RE
FA
TG
None of the given options (Page 71)

Question # 4 of 10 (Total Marks: 1) Select correct option:


For language L defined over {a, b},then L partitions {a, b}* into …… classes

Infinite
Finite
Distinct (Page 75)
Non distinct

Question # 5 of 10 (Total Marks: 1) Select correct option:


If an FA accept a word then there must exist a path from

Initial to final state (Page 81)


Initial to each state
Initial to each state but not to final state
Initial to final state by traversing each state

Question # 6 of 10 (Total Marks: 1) Select correct option:


Does the empty string match the regular expression |y+a|?

Yes
No (Page 3)

Question # 7 of 10 (Total Marks: 1) Select correct option:


If an FA already accepts the language expressed by the closure of certain RE, then the given FA is the required
FA.

True (Page 37)


False

Question # 8 of 10 (Total Marks: 1) Select correct option:


Which of the following statement is true about NFA with Null String?

Infinite states
Infinite set of letters
Infinite set of transitions
Transition of null string is allowed at any stage (Page 71)

22
Question # 9 of 10 (Total Marks: 1) Select correct option:
If R is a regular language and L is some language, and L U R is a regular language, then L must be a regular
language.

True (page 10)


False

Question # 10 of 10 (Total Marks: 1) Select correct option:


FA corresponding to an NFA can be built by introducing an empty state for a letter having

no transition at certain state (Page 43)


one transition at certain state
two transition at certain state
more than two transitions at certain state

Question # 1 of 10 (Total Marks: 1) Select correct option:


Let FA3 be an FA corresponding to FA1FA2, then the initial state of FA3 must correspond to the initial state of

FA1 only (Page 35)


FA2 only
FA1 or FA2
FA1 and FA2

Question # 2 of 10 (Total Marks: 1) Select correct option:


(a* + b*)* = (a + b)* this expression is __________
True
False

Question # 3 of 10 (Total Marks: 1) Select correct option:


If S = { x }, then S* will be
{x,xx,xxx,xxxx,…}
{^ ,x,xx,xxx,xxxx,…} (Page 10)

Question # 4 of 10 (Total Marks: 1) Select correct option:


The states in which there is no way to leave after entry are called
Davey John Lockers
Dead States
Waste Baskets
All of the given options (Page 17)

23
Question # 5 of 10 (Total Marks: 1) Select correct option:
If S = {ab, bb}, then S* will not contain
Abbbab
Bbba
ababbb
bbbbab

Question # 6 of 10 (Total Marks: 1) Select correct option:


According to theory of automata there are _________ types of languages

1
2 (Page 3)
3
4

Question # 7 of 10 (Total Marks: 1) Select correct option:


What do automata mean?
Something done manually
Something done automatically (Page 3)

Question # 8 of 10 (Total Marks: 1) Select correct option:


What is false about the term alphabet?
It is a finite set of symbols.
It is usually denoted by Greek letter sigma
It can be an empty set. (Page 3)
Strings are made up of its elements

Question # 9 of 10 (Total Marks: 1) Select correct option:


Formal is also known as _________
Syntactic language (page 3)
Semantic language
Informal language
Nsone of these

Question # 10 of 10 (Total Marks: 1) Select correct option:


Following are types of languages

Formal Languages (Syntactic languages)


Informal Languages (Semantic languages)
Both (Page 3)
None of above

24
CS402 – Quiz No.4
Question # 1 of 10 (Total Marks: 1) Select correct option:
Consider the following production (of a CFG): S->XYZ Here ______ is left most nonterminal in working
string. Note: S, X, Y and Z are all nonterminals
S
X
Y
Z

Question # 2 of 10 (Total Marks: 1) Select correct option:


A PDA is called nondeterministic PDA if ___________

There are more than one outgoing edges at READ or POP states with one label (Page 111)
There are more than one PUSH states
There are mroe than one POP states
All of the given options

Question # 3 of 10 (Total Marks: 1) Select correct option:


A PDA consists of the following:

An alphabet (Sigma) of input letters.


An input TAPE with infinite many locations in one direction
One START state with only one out-edge and no in-edge
All of the given options (Page 105)

Question # 4 of 10 (Total Marks: 1) Select correct option:


The CFG S --> aSa | bSb | a | b | ^ represents the language

EVEN-EVEN
PALINDROM (Page 91)
EQUAL
ODD-ODD

Question # 5 of 10 (Total Marks: 1) Select correct option:


Halt states are

Start and Accept


Accept and Reject (Page 105)
Start and Reject
Read and Reject

25
Question # 6 of 10 (Total Marks: 1) Select correct option:
Choice of path can be determined by left most derivation of the string belonging to CFL at………… state

Accept (Page 104)


Reject
Push
POP

Question # 7 of 10 (Total Marks: 1) Select correct option:


The unit and null productions can be deleted from a CFG

True (Page 99-100)


False

Question # 8 of 10 (Total Marks: 1) Select correct option:


Identify the TRUE statement about following CFG:
S -> SB|AB
A -> CC
B -> b
C -> a

The given CFG has 8 Nonterminals


The given CFG has 8 Terminals
The given CFG is in CNF (Page 101)
The given CFG is not in CNF

Question # 9 of 10 (Total Marks: 1) Select correct option:


The structure given below is called _________ S -> aA|bB A -> aS|a B -> bS|b

RE
TG
CFG (Page 87)
PDA

Question # 10 of 10 (Total Marks: 1) Select correct option:


Which of the following states is not part of PDA

START
ACCEPT
WRITE (Page 107)
REJECT

26
CS402 – Quiz No.4
Question # 1 of 10 (Total Marks: 1) Select correct option:
The production of the form: nonterminal --> one nonterminal is called the __________

Unit production (Page 100)


NULL production
Terminal production
Non Terminal production

Question # 2 of 10 (Total Marks: 1) Select correct option:


A _________ is the one for which every input string has a unique path through the machine.

Deterministic PDA (Page 111)


nondeterministic PDA
PUSHDOWN store
Input Tape

Question # 3 of 10 (Total Marks: 1) Select correct option:


In the null production N --> ^ , N is a

Terminal
Non terminal (Page 99)
Word
None of the given options

Question # 4 of 10 (Total Marks: 1) Select correct option:


The major problem in the earliest computers was

To store the contents in the registers


To display mathematical formulae (Page 87)
To load the contents from the registers
To calculate the mathematical formula

Question # 5 of 10 (Total Marks: 1) Select correct option:


In polish notation, (o-o-o) is the abbreviation of………?

Operand - Operator – Operand


Operand - Operand- Operator
Operator -Operand – Operand (Page 94)
Operand -Operand – Operand

27
Question # 6 of 10 (Total Marks: 1) Select correct option:
The CFG is said to be ambiguous if there exist at least one word of its language that can be generated by the
………… production trees

One
Two
More than one (Page 95)
At most one

Question # 7 of 10 (Total Marks: 1) Select correct option:


The input string is placed, before it runs, in

Stack
Memory
Tape (Page 105)
Ram

Question # 8 of 10 (Total Marks: 1) Select correct option:


The production S --> SS | a | b | ^ can be expressed by RE

(a+b)+
(a+b)
(a+b)* (Page 88)
(ab)*

Question # 9 of 10 (Total Marks: 1) Select correct option:


The locations into which we put the input letters on "Input Tap" are called __________

words
alphabets
cells (Page 105)
elements

Question # 10 of 10 (Total Marks: 1) Select correct option:


"CFG" stands for _________

Context Free Graph


Context Free Grammer (Page 87)
Context Finite Graph
Context Finite Grammer

28
Question # 1 of 10 (Total Marks: 1) Select correct option:
In a CFG the nonterminal that occurs first from the left in the working string, is said to be ________

Least Significant nonterminal


Most Significant nonterminal
Left most nonterminal (Page 103)
Left most derivate

Question # 2 of 10 (Total Marks: 1) Select correct option:


The unit production is

Terminal --> Terminal


Terminal --> Non Terminal
Non terminal --> Terminal
Non terminal --> Non Terminal (Page 100)

Question # 3 of 10 (Total Marks: 1) Select correct option:


A _____ operator adds a new letter at the top of STACK

PUSH (Page 107)


POP
READ
APPEND

Question # 4 of 10 (Total Marks: 1) Select correct option:


PDA stands for ________

Push and Drop Automaton


Pop and Drop Automaton
Push Down Automaton (Page 112)
None of given options

Question # 5 of 10 (Total Marks: 1) Select correct option:


The production of the form: Nonterminal-> ^ is said to be ______ production

NULL (Page 99)


UNIT
Chomsky form production
None of the given options

29
Question # 6 of 10 (Total Marks: 1) Select correct option:
If a CFG has a null production, then it is ______

Posiible to construct another CFG without null production accepting the same language with the
exception of the word ^ (Page 99)
Not possible to construct another CFG without null production accepting the same language with the exception
of the word ^
Called NULL CFG
Called Chmosky Normal Form (CNF)

Question # 7 of 10 (Total Marks: 1) Select correct option:


In a STACK:

The element PUSHed first is POPed first


The element PUSHed first is POPed in the last (Page 107 concept)
The element PUSHed in last is POPed in last
None of given options

Question # 8 of 10 (Total Marks: 1) Select correct option:


Kleene star closure can be defined
Over any set of string (Page 7)
Over specific type of string

Question # 9 of 10 (Total Marks: 1) Select correct option:


While finding RE corresponding to TG, we connect the new start state to the old start state by the transition
labeled by
A
B
null string (Page 26)
None of the given options

30
Some More Quizzes
Question # 1 of 10 (Total Marks: 1) Select correct option:
For a given input, it provides the compliment of Boolean AND output.

NAND box (NOT AND) (Page 63)


DELAY box
OR box
AND box

Question # 2 of 10 (Total Marks: 1) Select correct option:


It delays the transmission of signal along the wire by one step (clock pulse).

NAND box (NOT AND)


DELAY box (Page 63)
OR box
AND box

Question # 3 of 10 (Total Marks: 1) Select correct option:


For the given input, it provides the Boolean OR output

NAND box (NOT AND)


DELAY box
OR box (Page 63)
AND box

Question # 4 of 10 (Total Marks: 1) Select correct option:


For the given input, AND box provides the Boolean AND output.
True (Page 63)
False

Question # 5 of 10 (Total Marks: 1) Select correct option:


The current in the wire is indicated by 1 and 0 indicates the absence of the current.
True (Page 63)
False

Question # 6 of 10 (Total Marks: 1) Select correct option:


Any language that can not be expressed by a RE is said to be regular language.
True
False (Page 71)

31
Question # 7 of 10 (Total Marks: 1) Select correct option:
If L1 and L2 are regular languages_____ is/are also regular language(s).

L1 + L2
L1L2
L1*
All of above (Page 10)

Question # 8 of 10 (Total Marks: 1) Select correct option:


Let L be a language defined over an alphabet Σ, then the language of strings, defined over Σ, not belonging to
L, is called Complement of the language L, denoted by Lc or L‟.
True (Page 66)
False

Question # 9 of 10 (Total Marks: 1) Select correct option:


To describe the complement of a language, it is very important to describe the ----------- of that language over
which the language is defined.

Alphabet (Page 66)


Regular Expression
String
Word

Question # 10 of 10 (Total Marks: 1) Select correct option:


For a certain language L, the complement of Lc is the given language L i.e. (Lc)c = Lc
True
False (Page 66)

Question # 1 of 10 (Total Marks: 1) Select correct option:


If L is a regular language then, --------- is also a regular language.
Lm
Ls
Lx
Lc (Page 66)

Question # 2 of 10 (Total Marks: 1) Select correct option:


Converting each of the final states of F to non-final states and old non-final states of F to final states, FA thus
obtained will reject every string belonging to L and will accept every string, defined over Σ, not belonging to L.
is called
Transition Graph of L
Regular expression of L
Complement of L (Page 66)
Finite Automata of L

32
Question # 3 of 10 (Total Marks: 1) Select correct option:
If L1 and L2 are two regular languages, then L1 U L2 is not a regular.
True
False (Page 65)

Question # 4 of 10 (Total Marks: 1) Select correct option:


De-Morgan's law for sets is expressed by,
( L1c  L2 c )c  L1c  L2 c
( L1c  L2 c )c  L1c  L2 c
( L1c  L2 c )c  L1  L2
( L1c  L2 c )c  L1  L2 CORRECT (page 68)

Question # 5 of 10 (Total Marks: 1) Select correct option:


If L1 and L2 are regular languages, then these can be expressed by the corresponding FAs.
True (Page 68)
False

Question # 6 of 10 (Total Marks: 1) Select correct option:


L= language of words containing even number of a‟s. Regular Expression is

(a+b)*aa(a+b)*
(b+ab*a)* (Page 68)
a+bb*aab*a
(a+b)*ab(a+b)*

Question # 7 of 10 (Total Marks: 1) Select correct option:


The regular expression defining the language L1  L2 can be obtained, converting and reducing the previous ---
---------- into a ------------ as after eliminating states.

GTG, TG
FA, GTG (Page 69)
FA, TG
TG, RE

Question # 8 of 10 (Total Marks: 1) Select correct option:


The language that can be expressed by any regular expression is called a Non regular language.
True
False (Page 71)

33
Question # 9 of 10 (Total Marks: 1) Select correct option:
The languages -------------- are the examples of non regular languages.

PALINDROME and PRIME (Page 71)


PALINDROME and EVEN-EVEN
EVEN-EVEN and PRIME
FACTORIAL and SQURE

Question # 10 of 10 (Total Marks: 1) Select correct option:


Let L be any infinite regular language, defined over an alphabet Σ then there exist three strings x, y and z
belonging to Σ* such that all the strings of the form xy n z for n=1,2,3, … are the words in L. called.

Complement of L
Pumping Lemma (Page 72)
Kleene‟s theorem
None in given

Question # 1 of 10 (Total Marks: 1) Select correct option:


Languages are proved to be regular or non regular using pumping lemma.
True (Page 74)
False

Question # 2 of 10 (Total Marks: 1) Select correct option:


------------------- is obviously infinite language.
EQUAL-EQUAL
EVEN-EVEN
PALINDROME (Page 75)
FACTORIAL

Question # 3 of 10 (Total Marks: 1) Select correct option:


If, two strings x and y, defined over Σ, are run over an FA accepting the language L, then x and y are said to
belong to the same class if they end in the same state, no matter that state is final or not.
True (Page 75)
False

Question # 4 of 10 (Total Marks: 1) Select correct option:


Myhill Nerode theorem is consisting of the followings,

L partitions Σ* into distinct classes.


If L is regular then, L generates finite number of classes.
If L generates finite number of classes then L is regular.
All of above (Page 75)

34
Question # 5 of 10 (Total Marks: 1) Select correct option:
The language Q is said to be quotient of two regular languages P and R, denoted by--- if PQ=R.
R=Q/P
Q=R/P (Page 78)
Q=P/R
P=R/Q

Question # 6 of 10 (Total Marks: 1) Select correct option:


If two languages R and Q are given, then the prefixes of Q in R denoted by Pref(Q in R).
True (Page 78)
False

Question # 7 of 10 (Total Marks: 1) Select correct option:


Let Q = {aa, abaaabb, bbaaaaa, bbbbbbbbbb} and R = {b, bbbb, bbbaaa, bbbaaaaa} Pref (Q in R) is
equal to,

{b,bbba,bbbaaa} (Page 78)


{b,bba,bbaaa}
{ab,bba,bbbaa}
{b,bba,bbba}

Question # 8 of 10 (Total Marks: 1) Select correct option:


If R is regular language and Q is any language (regular/ non regular), then Pref (Q in R) is ---------.

Non-regular
Equal
Regular (Page 79)
Infinite

Question # 9 of 10 (Total Marks: 1) Select correct option:


___________ states are called the halt states.
ACCEPT and REJECT (Page 105)
ACCEPT and READ
ACCEPT AND START
ACCEPT AND WRITE

Question # 10 of 10 (Total Marks: 1) Select correct option:


The part of an FA, where the input string is placed before it is run, is called _______

State
Transition
Input Tape (Page 105)
Output Tape

35
Question # 1 of 10 (Total Marks: 1) Select correct option:
In new format of an FA (discussed in lecture 37), This state is like dead-end non final state

ACCEPT
REJECT (Page 105)
STATR
READ

Question # 2 of 10 (Total Marks: 1) Select correct option:


Between the two consecutive joints on a path

One character can be pushed and one character can be popped


Any no. of characters can be pushed and one character can be popped (Page 122)
One character can be pushed and any no. of characters can be popped
Any no. of characters can be pushed and any no. of characters can be popped

Question # 3 of 10 (Total Marks: 1) Select correct option:


The PDA is called non-deterministic PDA when there are more than one out going edges from……… state

START or READ
POP or REJECT
READ or POP (Page 111)
PUSH or POP

Question # 4 of 10 (Total Marks: 1) Select correct option:


Identify the TRUE statement:
A PDA is non-deterministic, if there are more than one READ states in PDA
A PDA is never non-deterministic
Like TG, A PDA can also be non-deterministic (Page 111)
A PDA is non-deterministic, if there are more than one REJECT states in PDA

Question # 5 of 10 (Total Marks: 1) Select correct option:


There is a problem in deciding whether a state of FA should be marked or not when the language Q is infinite.
True (Page 79)
False

Question # 6 of 10 (Total Marks: 1) Select correct option:


If an effectively solvable problem has answered in yes or no, then this solution is called ---------

Decision procedure (Page 80)


Decision method
Decision problem
Decision making

36
Question # 7 of 10 (Total Marks: 1) Select correct option:
The following problem(s) ------------- is/are called decidable problem(s).

The two regular expressions define the same language


The two FAs are equivalent
Both a and b (Page 80)
None of given

Question # 8 of 10 (Total Marks: 1) Select correct option:


To examine whether a certain FA accepts any words, it is required to seek the paths from ------- state.

Final to initial
Final to final
Initial to final (Page 81)
Initial to initial

Question # 9 of 10 (Total Marks: 1) Select correct option:


The high level language is converted into assembly language codes by a program called compiler.

TRUE (Page 87)


FALSE

Question # 10 of 10 (Total Marks: 1) Select correct option:


Grammatical rules which involve the meaning of words are called ---------------
Semantics (Page 87)
Syntactic
Both a and b
None of given

Question # 1 of 10 (Total Marks: 1) Select correct option:


Grammatical rules which do not involve the meaning of words are called ---------------
Semantics
Syntactic (Page 87)
Both a and b
None of given

Question # 2 of 10 (Total Marks: 1) Select correct option:


The symbols that must be replaced by other things are called __________

Productions
Terminals
Non-terminals (Page 87)
None of given

37
Question # 3 of 10 (Total Marks: 1) Select correct option:
The grammatical rules are often called_____________

Productions (Page 87)


Terminals
Non-terminals
None of given

Question # 4 of 10 (Total Marks: 1) Select correct option:


The terminals are designated by ________ letters, while the non-terminals are designated by ________ letters.
Capital, bold
Small, capital (Page 87)
Capital, small
Small, bold

Question # 5 of 10 (Total Marks: 1) Select correct option:


The language generated by __________ is called Context Free Language (CFL).
FA
TG
CFG (Page 87)
TGT

Question # 6 of 10 (Total Marks: 1) Select correct option:


Σ = {a,b} Productions S→XaaX
X→aX
X→bX
X→Λ
This grammar defines the language expressed by___________

(a+b)*aa(a+b)* (Page 89)


(a+b)*a(a+b)*a
(a+b)*aa(a+b)*aa
(a+b)*aba+b)*

Question # 7 of 10 (Total Marks: 1) Select correct option:


S → aXb|bXa
X → aX|bX|Λ
The given CFG generates the language in English __________

Beginning and ending in different letters (Page 91)


Beginning and ending in same letter
Having even-even language
None of given

38
Question # 8 of 10 (Total Marks: 1) Select correct option:
The CFG is not said to be ambiguous if there exists atleast one word of its language that can be generated by
the different production trees,

TRUE
FALSE (Page 95)

Question # 9 of 10 (Total Marks: 1) Select correct option:


The language generated by that CFG is regular if _________

No terminal → semi word


No terminal → word
Both a and b (Page 97)
None of given

Question # 10 of 10 (Total Marks: 1) Select correct option:


The production of the form no terminal → Λ is said to be null production.

TRUE (Page 99)


FALSE

Question # 1 of 10 (Total Marks: 1) Select correct option:


CNF is stands for

Context Normal Form


Complete Normal Form
Chomsky Normal Form (Page 102)
Compared Null Form

Question # 2 of 10 (Total Marks: 1) Select correct option:


Proof(Kleene‟s Theorem Part II)
If a TG has more than one start states, then

Introduce the new start state (Page 26)


Eliminate the old start state
Replace the old start state with final state
Replace the old final state with new start state

Question # 3 of 10 (Total Marks: 1) Select correct option:


Which of the following regular expression represents same language?
a. (a+ab)*
b. (ba+a)*
c. a*(aa*b)*
d. (a*b*)* (a+b)*a(a+b)*b(a+b)*+ (a+b)*b(a+b)*a(a+b)*.
39
{ x}*, { x}+, {a+b}*

Select correct option:


a and b (correct)
a and c
c and d

Question # 4 of 10 (Total Marks: 1) Select correct option:


Let FA3 be an FA corresponding to FA1+FA2, then the initial state of FA3 must correspond to the initial state
of

FA1 only
FA2 only
FA1 or FA2 (Page 32)
FA1 and FA2

Question # 5 of 10 (Total Marks: 1) Select correct option:


Which of the following statement is NOT true about TG?

There exists exactly one path for certain string (Page 19)
There may exist more than one paths for certain string
There may exist no path for certain string
There may be no final state

Question # 6 of 10 (Total Marks: 1) Select correct option:


Kleene‟s theorem states

All representations of a regular language are equivalent.


All representations of a context free language are equivalent.
All representations of a recursive language are equivalent
Finite Automata are less powerful than Pushdown Automata. (Page 105)

Question # 7 of 10 (Total Marks: 1) Select correct option:


A language accepted by an FA is also accepted by

TG only
GTG only
RE only
All of the given (Page 25)

40
Quiz No. 4
Question # 1of 10 (Total Marks: 1) Select correct option:
Consider the Following CFG: (NOTE: ^ means NULL) S->Xa X->aX|bX|^
above given CFG can be represented by RE _________

a*b*
a*b*a
(a+b)*a
a(a+b)*a

Question # 2 of 10 (Total Marks: 1) Select correct option:


Identify FALSE statement:

Every Regular Expression be expressed by CFG and every CFG can be expressed by a Regular
Expression (Page 97)
Every regular expression can be expressed as CFG but every CFG cannot be expressed as a regular expression.
For a PDA, there exists a CFG, that represents the same language as represented by PDA.
None of the given options

Question # 3 of 10 (Total Marks: 1) Select correct option:


Null production is a

Word
String
Terminal
All of the given options

Question # 4 of 10 (Total Marks: 1) Select correct option:


In nondeterministic PDA a string is supposed to be accepted, if there exists at least one path traced by the
string, leading to ______ state.

ACCEPT (Page 111)


REJECT
START
READ

41
Question # 5 of 10 (Total Marks: 1) Select correct option:
The CFG which generates the regular language is called

Regular expression
Finite Automata
Regular grammar (Page 97)
None of the given options

Question # 6 of 10 (Total Marks: 1) Select correct option:


If a CFG has a null production, then it is possible to construct another CFG accepting the same language
without null production

TRUE (Page 99)


FALSE

CS402 – Quiz No.2 (15 Jun 2013)


Question # 1 of 10 (Total Marks: 1) Select correct option
In large FA with thousands of states and millions of directed edges, without an effective procedure it is
________ to find a path from initial to final state.
Always easy
Impossible (Page 81)
may be good
always impossible

Question # 2 of 10 (Total Marks: 1) Select correct option


If there is no final state of two FAs then their ______ also have no _____ state
initial, union
final, union
union,final (Page 83)
union, initial

Question # 3 of 10 (Total Marks: 1) Select correct option


Set of all palindromes over {a,b} is:
Regular
Regular and finite
Regular and infinite
Non-regular (Page 71)

42
Question # 4 of 10 (Total Marks: 1) Select correct option
In the context of Myhill Nerode theorem, for even-even language sigma star can be partitioned into
__________ number of classes.

3
4 (Page 77)
5
6

Question # 5 of 10 (Total Marks: 1) Select correct option


The product of two regular languages is __________.

Regular (Page 78)


infinite
non-regular
closure of a regular language

Question # 6 of 10 (Total Marks: 1) Select correct option


If the FA has N states, then test the words of length less than N. If no word is accepted by this FA, then it will
_________ word/words.

accept all
accept no (Page 85) rep
accept some
reject no

Question # 7 of 10 (Total Marks: 1) Select correct option


An FA has same initial and _____ state, then it means that it has no _______ state.

initial, final
final, initial
initial, initial
none of the given options

Question # 8 of 10 (Total Marks: 1) Select correct option


A problem that has decision procedure is called _________ problem.

Regular language
un-decidable
Infinite
Decidable (Page 80)

43
Question # 9 of 10 (Total Marks: 1) Select correct option
For a machine with N number of states, the total number of strings to be tested, defined over an alphabet of m
letters, is___________.
Select correct option:

Nm +Nm+1+ N m+2 +… + N2m-1


m^N + m^N+1 + m^N + 2 +… +m2N-1 (Page 86)
Nm
mN

Question # 10 of 10 (Total Marks: 1) Select correct option


If (L1 ∩ L2c ) ∪ ( L1c ∩ L2 ) is regular language that accepts the words which are in L1 but not in L2 or else in
L2 but not in L1 . The corresponding FA cannot accept any word which is in _______ L1 and L2.
Not both
Both (Page 80)
At least in one
None of the given options

Question # 1 of 10 (Total Marks: 1) Select correct option


While determining regular expression for a given FA, it is _________ to write its regular expression.

Always possible easily


Sometime impossible (Page 80)
always impossible
None of the given options

Question # 2 of 10 (Total Marks: 1) Select correct option


Incase of Myhill Nerode theorem, if a language L partitions sigma star into distinct classes and L is also regular
then L generates_________ number of classes.

infinite
specified
finite (Page 75)
odd

44
CS402- Theory of Automata
Solved MCQS Feb 12,2013
From Midterm Papers
MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01

FINALTERM EXAMINATION
Spring 2010
CS402- Theory of Automata (Session - 1)

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


If r1 = (aa + bb) and r2 = ( a + b) then the language (aa + bb)(a + b) will be generated by

► (r1)(r2) (Page 10)


► (r1 + r2)
► (r2)(r1)
► (r1)*

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


“One language can be expressed by more than one FA”. This statement is ______
► True (Page 14)
► False
► Some times true & sometimes false
► None of these

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


Who did not invent the Turing machine?
► Alan Turing
► A. M. Turing (Page 140)
► Turing
► None of these

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


Which statement is true?
► The tape of turing machine is infinite. (Page 140)
► The tape of turing machine is finite.
► The tape of turing machine is infinite when the language is regular
► The tape of turing machine is finite when the language is nonregular.

1
Question No: 5 ( Marks: 1 ) - Please choose one
A regular language:
► Must be finite (Page 11)
► Must be infinite
► Can be finite or infinite
► Must be finite and cannot be infinite

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


Every regular expression can be expressed as CFG but every CFG cannot be expressed as a regular expression.
This statement is:
► Depends on the language
► None of the given options
► True (Page 97)
► False

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

a b b

X1– X2+

a
Above given FA corresponds RE r. then FA corresponding to r* will be
z1±

b a

b a

z3+ z2 a

b
This statement is
► True (Page 38)
► False
► Depends on language
► None of these

2
Question No: 8 ( Marks: 1 ) - Please choose one
Consider the language L of strings, defined over Σ = {a,b}, ending in a
► There are finite many classes generated by L, so L is regular (Page 76)
► There are infinite many classes generated by L, so L is regular
► There are finite many classes generated by L, so L is non-regular
► There are infinite many classes generated by L, so L is non-regular

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


aa,bb aa,bb
ab,ba


ab,ba
Above given TG has _____________ RE.
► (aa+aa+(ab+ab)(aa+ab)*(ab+ba))*
► (aa+bb+(ab+ba)(aa+bb)*(ab+ba))* (Page 22)
► (aa+bb+(ab+ba)(aa+bb)(ab+ba))*
► None of these

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


The word „formal‟ in formal languages means
► The symbols used have well defined meaning
► They are unnecessary, in reality
► Only the form of the string of symbols is significant Click here for detail
► None of these

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


Let A = {0, 1}. The number of possible strings of length „n‟ that can be formed by the elements of the set A is
► n!
► n2
► nm
► 2n

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


Choose the correct statement.
► A Mealy machine generates no language as such
► A Moore machine generates no language as such
► A Mealy machine has no terminal state
► All of these click here for detail

3
Question No: 13 ( Marks: 1 ) - Please choose one
TM is more powerful than FSM because
► The tape movement is confined to one direction
► It has no finite state control
► It has the capability to remember arbitrary long sequences of input symbols Click here for detail
► None of these

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


If L1 and L2 are expressed by regular expressions r1 and r2, respectively then the language expressed by r1 +
r2 will be _________
► Regular (Page 10)
► Ir-regular
► Can‟t be decided
► Another Language which is not listed here

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


Like TG, a PDA can also be non-deterministic
► True (Page 111)
► False

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

The above machine is a/anTG ___________


► Finite Automata
► Turing machine (Page 141)
► FA
► TG

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


The language of all words (made up of a‟s and b‟s) with at least two a‟s can not be described by the regular
expression.
► a(a+b)*a(a+b)*(a+b)*ab*
► (a+b)* ab* a(a+b)*
► b*ab* a(a+b)*
► none of these
anbn {where n>0} is the language will at least one a and b and cannot be described by RE.

4
Question No: 18 ( Marks: 1 ) - Please choose one
In FA, if one enters in a specific state but there is no way to leave it, then that specific state is called
► Dead State
► Waste Basket
► Davey John Locker
► All of these (Page 17)

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


If L is a regular language then, Lc is also a _____ language.
► Regular (Page 66)
► Non-regular
► Regular but finite
► None of the given

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


In CFG, the symbols that can‟t be replaced by anything are called___
► Terminal (Page 87)
► Non-Terminal
► Production
► All of given

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


Which of the following is NOT a regular language?
► String of 0‟s whose length is a perfect squere
► Set of all palindromes made up of 0‟s and 1‟s
► String of 0‟s whose length is a prime number
► All of the given options Click here for detail

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


Choose the incorrect (FALSE) statement.
► A Mealy machine generates no language as such
► A Mealy machine has no terminal state
► For a given input string, length of the output string generated by a Moore machine is not more
than the length of the output string generated by that of a Mealy machine click here for detail
► All of these

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


Pumping lemma is generally used to prove that:
► A given language is infinite
► A given language is not regular Click here for detail
► Whether two given regular expressions of a regular language are equivalent or not
► None of these

5
Question No: 24 ( Marks: 1 ) - Please choose one
Which of the following is a regular language?
► String of odd number of zeroes Click here for detail
► Set of all palindromes made up of 0‟s and 1‟s
► String of 0‟s whose length is a prime number
► All of these

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


Choose the incorrect statement:
► (a+b)*aa(a+b)* generates Regular language.
► A language consisting of all strings over ∑={a,b} having equal number of a’s and b’s is a regular
language
► Every language that can be expressed by FA can also be expressed by RE
► None of these

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


Left hand side of a production in CFG consists of:
► One terminal
► More than one terminal
► One non-terminal (Page 87)
► Terminals and non-terminals

FINALTERM EXAMINATION
SPRING 2007

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


PDA is only used to represent a regular language.
► True
► False Click here for detail

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


If L is a regular language then LC is also a regular language.
► True (Page 66)
► False

6
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 (Page 127)
► False

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


We can find a CFG corresponding to a DFA.
► True (Page 97)
► False

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


START, READ, HERE and ACCEPTS are conversions of the machine
► True (Page 122)
► 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 (Page 95)
► False

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


Syntax tree or Generation tree or Derivation tree are same tree
► True (Page 92)
► False

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


The symbols that cannot be replaced by anything are called terminals
► True (Page 87)
► False

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


The production of the form non-terminal  one non-terminal is called unit production
► True (Page 100)
► False

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


DFA and PDA are equal in power.
► True
► False (Page 105)

7
FINALTERM EXAMINATION
Spring 2006
CS402- Theory of Automata

Question No. 1
A production of the form non-terminal  non-terminal is called a dead Production.
True
False (Page 127)

Question No. 2
Semi-word is a string having some terminals and one non-terminal at the right of string.
True (Page 97)
False

Question No. 3
Two FAs are equivalent if they have same no. of states.
True (Page 15)
False

Question No. 4
There exist exactly two different derivations in an ambiguous CFG for a word.
True (Page 93)
False

Question No. 6
Regular languages are closed under Union, Concatenation and Kleene star.
True (Page 10)
False

Question No. 7
CFG may also represent a regular language.
True (Page 97)
False

Question No. 9 Marks : 1


PDA is stronger than FA.
True (Page 105)
False

8
FINALTERM EXAMINATION
Spring 2005
CS402- Theory of Automata

Question No. 1
A Total Language Tree has
All languages over Σ
All strings over Σ (Page 96)
All words of all languages over Σ
All words of one language over Σ

Question No. 2
What Turing Machine does not have?
Stack
Tape
Head
Word
Turing machine has stack but insertion and deletion can be done from both sides. Tape and head to.

Question No. 3
CFG given S  bS|Sb|aa represents language
b*aa
aab*
b*aab*
b*(aa)*b*

Question No. 4
A Language that is finite but not regular
Λ
(a+b)*
Φ (not sure)
All strings of a's in Σ = {a,.b}

9
CS402 – Quiz No.3

Question # 1 of 10 (Total Marks: 1) Select correct option:


The values of input (say a & b) does not remain same in one cycle due to
NAND gate
Click plus
OR gate
NOT gate

Question # 2 of 10 (Total Marks: 1) Select correct option:


Set of all palindromes over {a,b}is regular

True
False (Page 74)

Question # 3 of 10 (Total Marks: 1) Select correct option:


In CFG, the symbols that cannot be replaced by anything are called

Terminals (Page 87)


Non terminals
Productions
None of the given options

Question # 4 of 10 (Total Marks: 1) Select correct option:


a^n b^n generates the ………… language

regular
non regular
EQUAL and non regular (Page 71)
EQUAL and regular

Question # 5 of 10 (Total Marks: 1) Select correct option:


The grammatical rules which involves meaning of words are called:

Semantic (Page 87)


Sytactics
Alphabets
None of he given options

10
Question # 6 of 10 (Total Marks: 1) Select correct option:
The reverse of the string sbfsbb over { sb, f, b }

bbsfbs
bsbfsb
sbbfsb
bsfbsb

Question # 7 of 10 (Total Marks: 1) Select correct option:


If an FA has N state then it must accept the word of length

N-1
N+1
N+2N

Question # 8 of 10 (Total Marks: 1) Select correct option:


Two languages are said to belong to same class if they end in the same state when they run over an FA, that
state

Must be final state


May be final state or not (Page 75)
May be start or not
None of the given options

Question # 9 of 10 (Total Marks: 1) Select correct option:


In pref(Q in R) Q is …… to (than) R

Equal
Not Equal (Page 79)
Greater
Smaller

Question # 10 of 10 (Total Marks: 1) Select correct option:


According to Myhill Nerode theorem, if L generates finite no. of classes then L is.......

Finite
Infinite
Regular (Page 76)
Non Regular

11
Question # 1 of 10 (Total Marks: 1) Select correct option:
If the intersection of two regular languages is regular then the complement of the intersection of these two
languages is also regular

True (Page 68)


False

Question # 2 of 10 (Total Marks: 1) Select correct option:


In pumping lemma theorem (x y^n z) the range of n is

n=1,2,3,4..... (Page 74)


n=0,1,2,3,4....
n=-3,-2,-1,0,1,2,3,4.....
n=-3,-2,-1,1,2,3,4.....

Question # 3 of 10 (Total Marks: 1) Select correct option:


The complement of a regular language is also a regular

True rep
False

CS402 – Quiz No.3


Question # 1 of 10 (Total Marks: 1) Select correct option:
For a non regular language there exist …… FA

One
At least one
At most one
No (Page 71)

Question # 2 of 10 (Total Marks: 1) Select correct option:


The strings or words which do not belong to a language is called…………. of that language

Intersection
Union
Complement (Page 66)
Quotient

12
Question # 3 of 10 (Total Marks: 1) Select correct option:
A non regular language can be represented by
RE
FA
TG
None of the given options (Page 71)

Question # 4 of 10 (Total Marks: 1) Select correct option:


For language L defined over {a, b},then L partitions {a, b}* into …… classes

Infinite
Finite
Distinct (Page 75)
Non distinct

Question # 5 of 10 (Total Marks: 1) Select correct option:


If an FA accept a word then there must exist a path from

Initial to final state (Page 81)


Initial to each state
Initial to each state but not to final state
Initial to final state by traversing each state

Question # 6 of 10 (Total Marks: 1) Select correct option:


Does the empty string match the regular expression |y+a|?

Yes
No (Page 3)

Question # 7 of 10 (Total Marks: 1) Select correct option:


If an FA already accepts the language expressed by the closure of certain RE, then the given FA is the required
FA.

True (Page 37)


False

Question # 8 of 10 (Total Marks: 1) Select correct option:


Which of the following statement is true about NFA with Null String?

Infinite states
Infinite set of letters
Infinite set of transitions
Transition of null string is allowed at any stage (Page 71)

13
Question # 9 of 10 (Total Marks: 1) Select correct option:
If R is a regular language and L is some language, and L U R is a regular language, then L must be a regular
language.

True (page 10)


False

Question # 10 of 10 (Total Marks: 1) Select correct option:


FA corresponding to an NFA can be built by introducing an empty state for a letter having

no transition at certain state (Page 43)


one transition at certain state
two transition at certain state
more than two transitions at certain state

Question # 1 of 10 (Total Marks: 1) Select correct option:


Let FA3 be an FA corresponding to FA1FA2, then the initial state of FA3 must correspond to the initial state of

FA1 only (Page 35)


FA2 only
FA1 or FA2
FA1 and FA2

Question # 2 of 10 (Total Marks: 1) Select correct option:


(a* + b*)* = (a + b)* this expression is __________
True
False

Question # 3 of 10 (Total Marks: 1) Select correct option:


If S = { x }, then S* will be
{x,xx,xxx,xxxx,…}
{^ ,x,xx,xxx,xxxx,…} (Page 10)

Question # 4 of 10 (Total Marks: 1) Select correct option:


The states in which there is no way to leave after entry are called
Davey John Lockers
Dead States
Waste Baskets
All of the given options (Page 17)

14
Question # 5 of 10 (Total Marks: 1) Select correct option:
If S = {ab, bb}, then S* will not contain
Abbbab
Bbba
ababbb
bbbbab

Question # 6 of 10 (Total Marks: 1) Select correct option:


According to theory of automata there are _________ types of languages

1
2 (Page 3)
3
4

Question # 7 of 10 (Total Marks: 1) Select correct option:


What do automata mean?
Something done manually
Something done automatically (Page 3)

Question # 8 of 10 (Total Marks: 1) Select correct option:


What is false about the term alphabet?
It is a finite set of symbols.
It is usually denoted by Greek letter sigma
It can be an empty set. (Page 3)
Strings are made up of its elements

Question # 9 of 10 (Total Marks: 1) Select correct option:


Formal is also known as _________
Syntactic language (page 3)
Semantic language
Informal language
Nsone of these

Question # 10 of 10 (Total Marks: 1) Select correct option:


Following are types of languages

Formal Languages (Syntactic languages)


Informal Languages (Semantic languages)
Both (Page 3)
None of above

15
CS402 – Quiz No.4
Question # 1 of 10 (Total Marks: 1) Select correct option:
Consider the following production (of a CFG): S->XYZ Here ______ is left most nonterminal in working
string. Note: S, X, Y and Z are all nonterminals
S
X
Y
Z

Question # 2 of 10 (Total Marks: 1) Select correct option:


A PDA is called nondeterministic PDA if ___________

There are more than one outgoing edges at READ or POP states with one label (Page 111)
There are more than one PUSH states
There are mroe than one POP states
All of the given options

Question # 3 of 10 (Total Marks: 1) Select correct option:


A PDA consists of the following:

An alphabet (Sigma) of input letters.


An input TAPE with infinite many locations in one direction
One START state with only one out-edge and no in-edge
All of the given options (Page 105)

Question # 4 of 10 (Total Marks: 1) Select correct option:


The CFG S --> aSa | bSb | a | b | ^ represents the language

EVEN-EVEN
PALINDROM (Page 91)
EQUAL
ODD-ODD

Question # 5 of 10 (Total Marks: 1) Select correct option:


Halt states are

Start and Accept


Accept and Reject (Page 105)
Start and Reject
Read and Reject

16
Question # 6 of 10 (Total Marks: 1) Select correct option:
Choice of path can be determined by left most derivation of the string belonging to CFL at………… state

Accept (Page 104)


Reject
Push
POP

Question # 7 of 10 (Total Marks: 1) Select correct option:


The unit and null productions can be deleted from a CFG

True (Page 99-100)


False

Question # 8 of 10 (Total Marks: 1) Select correct option:


Identify the TRUE statement about following CFG:
S -> SB|AB
A -> CC
B -> b
C -> a

The given CFG has 8 Nonterminals


The given CFG has 8 Terminals
The given CFG is in CNF (Page 101)
The given CFG is not in CNF

Question # 9 of 10 (Total Marks: 1) Select correct option:


The structure given below is called _________ S -> aA|bB A -> aS|a B -> bS|b

RE
TG
CFG (Page 87)
PDA

Question # 10 of 10 (Total Marks: 1) Select correct option:


Which of the following states is not part of PDA

START
ACCEPT
WRITE (Page 107)
REJECT

17
CS402 – Quiz No.4
Question # 1 of 10 (Total Marks: 1) Select correct option:
The production of the form: nonterminal --> one nonterminal is called the __________

Unit production (Page 100)


NULL production
Terminal production
Non Terminal production

Question # 2 of 10 (Total Marks: 1) Select correct option:


A _________ is the one for which every input string has a unique path through the machine.

Deterministic PDA (Page 111)


nondeterministic PDA
PUSHDOWN store
Input Tape

Question # 3 of 10 (Total Marks: 1) Select correct option:


In the null production N --> ^ , N is a

Terminal
Non terminal (Page 99)
Word
None of the given options

Question # 4 of 10 (Total Marks: 1) Select correct option:


The major problem in the earliest computers was

To store the contents in the registers


To display mathematical formulae (Page 87)
To load the contents from the registers
To calculate the mathematical formula

Question # 5 of 10 (Total Marks: 1) Select correct option:


In polish notation, (o-o-o) is the abbreviation of………?

Operand - Operator – Operand


Operand - Operand- Operator
Operator -Operand – Operand (Page 94)
Operand -Operand – Operand

18
Question # 6 of 10 (Total Marks: 1) Select correct option:
The CFG is said to be ambiguous if there exist at least one word of its language that can be generated by the
………… production trees

One
Two
More than one (Page 95)
At most one

Question # 7 of 10 (Total Marks: 1) Select correct option:


The input string is placed, before it runs, in

Stack
Memory
Tape (Page 105)
Ram

Question # 8 of 10 (Total Marks: 1) Select correct option:


The production S --> SS | a | b | ^ can be expressed by RE

(a+b)+
(a+b)
(a+b)* (Page 88)
(ab)*

Question # 9 of 10 (Total Marks: 1) Select correct option:


The locations into which we put the input letters on "Input Tap" are called __________

words
alphabets
cells (Page 105)
elements

Question # 10 of 10 (Total Marks: 1) Select correct option:


"CFG" stands for _________

Context Free Graph


Context Free Grammer (Page 87)
Context Finite Graph
Context Finite Grammer

19
Question # 1 of 10 (Total Marks: 1) Select correct option:
In a CFG the nonterminal that occurs first from the left in the working string, is said to be ________

Least Significant nonterminal


Most Significant nonterminal
Left most nonterminal (Page 103)
Left most derivate

Question # 2 of 10 (Total Marks: 1) Select correct option:


The unit production is

Terminal --> Terminal


Terminal --> Non Terminal
Non terminal --> Terminal
Non terminal --> Non Terminal (Page 100)

Question # 3 of 10 (Total Marks: 1) Select correct option:


A _____ operator adds a new letter at the top of STACK

PUSH (Page 107)


POP
READ
APPEND

Question # 4 of 10 (Total Marks: 1) Select correct option:


PDA stands for ________

Push and Drop Automaton


Pop and Drop Automaton
Push Down Automaton (Page 112)
None of given options

Question # 5 of 10 (Total Marks: 1) Select correct option:


The production of the form: Nonterminal-> ^ is said to be ______ production

NULL (Page 99)


UNIT
Chomsky form production
None of the given options

20
Question # 6 of 10 (Total Marks: 1) Select correct option:
If a CFG has a null production, then it is ______

Posiible to construct another CFG without null production accepting the same language with the
exception of the word ^ (Page 99)
Not possible to construct another CFG without null production accepting the same language with the exception
of the word ^
Called NULL CFG
Called Chmosky Normal Form (CNF)

Question # 7 of 10 (Total Marks: 1) Select correct option:


In a STACK:

The element PUSHed first is POPed first


The element PUSHed first is POPed in the last (Page 107 concept)
The element PUSHed in last is POPed in last
None of given options

Question # 8 of 10 (Total Marks: 1) Select correct option:


Kleene star closure can be defined
Over any set of string (Page 7)
Over specific type of string

Question # 9 of 10 (Total Marks: 1) Select correct option:


While finding RE corresponding to TG, we connect the new start state to the old start state by the transition
labeled by
A
B
null string (Page 26)
None of the given options

21
Some More Quizzes

Question # 1 of 10 (Total Marks: 1) Select correct option:


For a given input, it provides the compliment of Boolean AND output.

NAND box (NOT AND) (Page 63)


DELAY box
OR box
AND box

Question # 2 of 10 (Total Marks: 1) Select correct option:


It delays the transmission of signal along the wire by one step (clock pulse).

NAND box (NOT AND)


DELAY box (Page 63)
OR box
AND box

Question # 3 of 10 (Total Marks: 1) Select correct option:


For the given input, it provides the Boolean OR output

NAND box (NOT AND)


DELAY box
OR box (Page 63)
AND box

Question # 4 of 10 (Total Marks: 1) Select correct option:


For the given input, AND box provides the Boolean AND output.
True (Page 63)
False

Question # 5 of 10 (Total Marks: 1) Select correct option:


The current in the wire is indicated by 1 and 0 indicates the absence of the current.
True (Page 63)
False

Question # 6 of 10 (Total Marks: 1) Select correct option:


Any language that can not be expressed by a RE is said to be regular language.
True
False (Page 71)

22
Question # 7 of 10 (Total Marks: 1) Select correct option:
If L1 and L2 are regular languages_____ is/are also regular language(s).

L1 + L2
L1L2
L1*
All of above (Page 10)

Question # 8 of 10 (Total Marks: 1) Select correct option:


Let L be a language defined over an alphabet Σ, then the language of strings, defined over Σ, not belonging to
L, is called Complement of the language L, denoted by Lc or L‟.
True (Page 66)
False

Question # 9 of 10 (Total Marks: 1) Select correct option:


To describe the complement of a language, it is very important to describe the ----------- of that language over
which the language is defined.

Alphabet (Page 66)


Regular Expression
String
Word

Question # 10 of 10 (Total Marks: 1) Select correct option:


For a certain language L, the complement of Lc is the given language L i.e. (Lc)c = Lc
True
False (Page 66)

Question # 1 of 10 (Total Marks: 1) Select correct option:


If L is a regular language then, --------- is also a regular language.
Lm
Ls
Lx
Lc (Page 66)

Question # 2 of 10 (Total Marks: 1) Select correct option:


Converting each of the final states of F to non-final states and old non-final states of F to final states, FA thus
obtained will reject every string belonging to L and will accept every string, defined over Σ, not belonging to L.
is called
Transition Graph of L
Regular expression of L
Complement of L (Page 66)
Finite Automata of L

23
Question # 3 of 10 (Total Marks: 1) Select correct option:
If L1 and L2 are two regular languages, then L1 U L2 is not a regular.
True
False (Page 65)

Question # 4 of 10 (Total Marks: 1) Select correct option:


De-Morgan's law for sets is expressed by,
( L1c  L2 c )c  L1c  L2 c
( L1c  L2 c )c  L1c  L2 c
( L1c  L2 c )c  L1  L2
( L1c  L2 c )c  L1  L2 CORRECT (page 68)

Question # 5 of 10 (Total Marks: 1) Select correct option:


If L1 and L2 are regular languages, then these can be expressed by the corresponding FAs.
True (Page 68)
False

Question # 6 of 10 (Total Marks: 1) Select correct option:


L= language of words containing even number of a‟s. Regular Expression is

(a+b)*aa(a+b)*
(b+ab*a)* (Page 68)
a+bb*aab*a
(a+b)*ab(a+b)*

Question # 7 of 10 (Total Marks: 1) Select correct option:


The regular expression defining the language L1  L2 can be obtained, converting and reducing the previous ---
---------- into a ------------ as after eliminating states.

GTG, TG
FA, GTG (Page 69)
FA, TG
TG, RE

Question # 8 of 10 (Total Marks: 1) Select correct option:


The language that can be expressed by any regular expression is called a Non regular language.
True
False (Page 71)

24
Question # 9 of 10 (Total Marks: 1) Select correct option:
The languages -------------- are the examples of non regular languages.

PALINDROME and PRIME (Page 71)


PALINDROME and EVEN-EVEN
EVEN-EVEN and PRIME
FACTORIAL and SQURE

Question # 10 of 10 (Total Marks: 1) Select correct option:


Let L be any infinite regular language, defined over an alphabet Σ then there exist three strings x, y and z
belonging to Σ* such that all the strings of the form xy n z for n=1,2,3, … are the words in L. called.

Complement of L
Pumping Lemma (Page 72)
Kleene‟s theorem
None in given

Question # 1 of 10 (Total Marks: 1) Select correct option:


Languages are proved to be regular or non regular using pumping lemma.
True (Page 74)
False

Question # 2 of 10 (Total Marks: 1) Select correct option:


------------------- is obviously infinite language.
EQUAL-EQUAL
EVEN-EVEN
PALINDROME (Page 75)
FACTORIAL

Question # 3 of 10 (Total Marks: 1) Select correct option:


If, two strings x and y, defined over Σ, are run over an FA accepting the language L, then x and y are said to
belong to the same class if they end in the same state, no matter that state is final or not.
True (Page 75)
False

Question # 4 of 10 (Total Marks: 1) Select correct option:


Myhill Nerode theorem is consisting of the followings,

L partitions Σ* into distinct classes.


If L is regular then, L generates finite number of classes.
If L generates finite number of classes then L is regular.
All of above (Page 75)

25
Question # 5 of 10 (Total Marks: 1) Select correct option:
The language Q is said to be quotient of two regular languages P and R, denoted by--- if PQ=R.
R=Q/P
Q=R/P (Page 78)
Q=P/R
P=R/Q

Question # 6 of 10 (Total Marks: 1) Select correct option:


If two languages R and Q are given, then the prefixes of Q in R denoted by Pref(Q in R).
True (Page 78)
False

Question # 7 of 10 (Total Marks: 1) Select correct option:


Let Q = {aa, abaaabb, bbaaaaa, bbbbbbbbbb} and R = {b, bbbb, bbbaaa, bbbaaaaa} Pref (Q in R) is
equal to,

{b,bbba,bbbaaa} (Page 78)


{b,bba,bbaaa}
{ab,bba,bbbaa}
{b,bba,bbba}

Question # 8 of 10 (Total Marks: 1) Select correct option:


If R is regular language and Q is any language (regular/ non regular), then Pref (Q in R) is ---------.

Non-regular
Equal
Regular (Page 79)
Infinite

Question # 9 of 10 (Total Marks: 1) Select correct option:


___________ states are called the halt states.
ACCEPT and REJECT (Page 105)
ACCEPT and READ
ACCEPT AND START
ACCEPT AND WRITE

Question # 10 of 10 (Total Marks: 1) Select correct option:


The part of an FA, where the input string is placed before it is run, is called _______

State
Transition
Input Tape (Page 105)
Output Tape

26
Question # 1 of 10 (Total Marks: 1) Select correct option:
In new format of an FA (discussed in lecture 37), This state is like dead-end non final state

ACCEPT
REJECT (Page 105)
STATR
READ

Question # 2 of 10 (Total Marks: 1) Select correct option:


Between the two consecutive joints on a path

One character can be pushed and one character can be popped


Any no. of characters can be pushed and one character can be popped (Page 122)
One character can be pushed and any no. of characters can be popped
Any no. of characters can be pushed and any no. of characters can be popped

Question # 3 of 10 (Total Marks: 1) Select correct option:


The PDA is called non-deterministic PDA when there are more than one out going edges from……… state

START or READ
POP or REJECT
READ or POP (Page 111)
PUSH or POP

Question # 4 of 10 (Total Marks: 1) Select correct option:


Identify the TRUE statement:
A PDA is non-deterministic, if there are more than one READ states in PDA
A PDA is never non-deterministic
Like TG, A PDA can also be non-deterministic (Page 111)
A PDA is non-deterministic, if there are more than one REJECT states in PDA

Question # 5 of 10 (Total Marks: 1) Select correct option:


There is a problem in deciding whether a state of FA should be marked or not when the language Q is infinite.
True (Page 79)
False

Question # 6 of 10 (Total Marks: 1) Select correct option:


If an effectively solvable problem has answered in yes or no, then this solution is called ---------

Decision procedure (Page 80)


Decision method
Decision problem
Decision making

27
Question # 7 of 10 (Total Marks: 1) Select correct option:
The following problem(s) ------------- is/are called decidable problem(s).

The two regular expressions define the same language


The two FAs are equivalent
Both a and b (Page 80)
None of given

Question # 8 of 10 (Total Marks: 1) Select correct option:


To examine whether a certain FA accepts any words, it is required to seek the paths from ------- state.

Final to initial
Final to final
Initial to final (Page 81)
Initial to initial

Question # 9 of 10 (Total Marks: 1) Select correct option:


The high level language is converted into assembly language codes by a program called compiler.

TRUE (Page 87)


FALSE

Question # 10 of 10 (Total Marks: 1) Select correct option:


Grammatical rules which involve the meaning of words are called ---------------
Semantics (Page 87)
Syntactic
Both a and b
None of given

Question # 1 of 10 (Total Marks: 1) Select correct option:


Grammatical rules which do not involve the meaning of words are called ---------------
Semantics
Syntactic (Page 87)
Both a and b
None of given

Question # 2 of 10 (Total Marks: 1) Select correct option:


The symbols that must be replaced by other things are called __________

Productions
Terminals
Non-terminals (Page 87)
None of given

28
Question # 3 of 10 (Total Marks: 1) Select correct option:
The grammatical rules are often called_____________

Productions (Page 87)


Terminals
Non-terminals
None of given

Question # 4 of 10 (Total Marks: 1) Select correct option:


The terminals are designated by ________ letters, while the non-terminals are designated by ________ letters.
Capital, bold
Small, capital (Page 87)
Capital, small
Small, bold

Question # 5 of 10 (Total Marks: 1) Select correct option:


The language generated by __________ is called Context Free Language (CFL).
FA
TG
CFG (Page 87)
TGT

Question # 6 of 10 (Total Marks: 1) Select correct option:


Σ = {a,b} Productions S→XaaX
X→aX
X→bX
X→Λ
This grammar defines the language expressed by___________

(a+b)*aa(a+b)* (Page 89)


(a+b)*a(a+b)*a
(a+b)*aa(a+b)*aa
(a+b)*aba+b)*

Question # 7 of 10 (Total Marks: 1) Select correct option:


S → aXb|b
XaX → aX|bX|Λ
The given CFG generates the language in English __________

Beginning and ending in different letters (Page 91)


Beginning and ending in same letter
Having even-even language
None of given

29
Question # 8 of 10 (Total Marks: 1) Select correct option:
The CFG is not said to be ambiguous if there exists atleast one word of its language that can be generated by
the different production trees,

TRUE
FALSE (Page 95)

Question # 9 of 10 (Total Marks: 1) Select correct option:


The language generated by that CFG is regular if _________

No terminal → semi word


No terminal → word
Both a and b (Page 97)
None of given

Question # 10 of 10 (Total Marks: 1) Select correct option:


The production of the form no terminal → Λ is said to be null production.

TRUE (Page 99)


FALSE

Question # 1 of 10 (Total Marks: 1) Select correct option:


CNF is stands for

Context Normal Form


Complete Normal Form
Chomsky Normal Form (Page 102)
Compared Null Form

Question # 2 of 10 (Total Marks: 1) Select correct option:


Proof(Kleene‟s Theorem Part II)
If a TG has more than one start states, then

Introduce the new start state (Page 26)


Eliminate the old start state
Replace the old start state with final state
Replace the old final state with new start state

Question # 3 of 10 (Total Marks: 1) Select correct option:


Which of the following regular expression represents same language?
a. (a+ab)*
b. (ba+a)*
c. a*(aa*b)*
d. (a*b*)* (a+b)*a(a+b)*b(a+b)*+ (a+b)*b(a+b)*a(a+b)*.
30
{ x}*, { x}+, {a+b}*

Select correct option:


a and b (correct)
a and c
c and d

Question # 4 of 10 (Total Marks: 1) Select correct option:


Let FA3 be an FA corresponding to FA1+FA2, then the initial state of FA3 must correspond to the initial state
of

FA1 only
FA2 only
FA1 or FA2 (Page 32)
FA1 and FA2

Question # 5 of 10 (Total Marks: 1) Select correct option:


Which of the following statement is NOT true about TG?

There exists exactly one path for certain string (Page 19)
There may exist more than one paths for certain string
There may exist no path for certain string
There may be no final state

Question # 6 of 10 (Total Marks: 1) Select correct option:


Kleene‟s theorem states

All representations of a regular language are equivalent.


All representations of a context free language are equivalent.
All representations of a recursive language are equivalent
Finite Automata are less powerful than Pushdown Automata. (Page 105)

Question # 7 of 10 (Total Marks: 1) Select correct option:


A language accepted by an FA is also accepted by

TG only
GTG only
RE only
All of the given (Page 25)

31
CS402 Grand Quiz File Spring 2021
Instructor Munir

1. FA of EVEN Language Shows null string when ______________

 initial state is final as well

2. when even length language is expressed by an FA. then it will have minimum_______states

 two

3.which of the following regular expressions represent same language?

1. (a+ab)*

2.(ba+a)*

3.a*(aa*b)*

4.(a*b*)*

 1 and 3

4. FA stand for _______

 Finite Automation

5. If an alphabet has "2" number of letters, then total number of strings of length "3" will be
_______

 8

6. Which of the following is the bypass and state elimination step in the context of Kleeene's
theorem part II proof?

 4

7. Which the following is free of non-determinism?

 FA

8. Let FA3 be an FA corresponding to FA1FA2, then the initial state of FA3 must correspond to
the initial state of

http://instructormunir.blogspot.com/ Page 1
 FA1 only

9. If we have only one state, having no transition for input letters, then it is an example:

 NFA

10. Let S={a,bb,bab,baabb} be a set of string, which one of the following will not be included in
S*?

 bbbaabaabb

11. Consider the following RE:

a(a+b)b*

All of the following words are accepted except_______

 aba

12 Consider we have languages L7 and L6, Which of the following represents their
concatenation?

 L7L6

13. _______ state is not important in Moore machine.

 Initial

14. All possible combinations of strings of a language including null string is referred as:

 Kleene star closure of a language

15. A transition graph is converted into a(n) _____ in order to obtain regular expression.

 GTG

16. If an FA has 3 states and 2 letters in the alphabet set, then it will have total _______ number
of transitions.

 6

17. Formal is also known as_______.

 Syntactic language

18. Suppose we have FA3 which is equal to the union of FA1 and FA2. Now the initial state of
the FA3 will be equal to:

 Initial state of FA1 and FA2

http://instructormunir.blogspot.com/ Page 2
19. GTG for expression (aa+aba)* may have minimum number of states"

 1

20. Which of the following machine has only one initial state and no final state?

 Moore machine

21. In proving Kleene Theorem II, if three states are connected then middle state is removed by
connecting first and third state and writing corresponding RE in:

 Concatenation

22. Introducing new final state in case of multiple final states is the step no._____ of proving
Kleene's theorem part II.

 2

23. Non-determinism is present in:

 Both TG and GTG

24. Melay machine can have _____ final states.

 Zero

25. FA corresponding to an NFA can be built by introducing an empty state for a letter having

 no transition at certain state

26. If r1 is a regular expression then (r1)* is ________

 also a regular expression

27. Which one of the following word is not accpeted by the given regular expression?

 baabaabba

28. If S={a,b} then which of the following RE will generate all possible strings?

 (a+b)*

29. Every NFA can be considered to be a ______ as well, but the converse may not be true.

 TG

30. If "r1" and "r2" are regular expression, then which of the following is not a regular
expression?

http://instructormunir.blogspot.com/ Page 3
 r1-r2

31.which of the following diagrams express languages more simply?

 GTG

32.Kleene's Theorem Part II expresses the relationship between___________.

 TG And RE

33.NFA with null string has ----------initial state(s).

 one

34.There maybe more than one transition for a certain letter on a state in:

 Non-Deterministic Finite Automata

35.Which of the following strings belongs to the language of the regular expression (aa*b)*?

 aabaab

36. In concatenation, we include the initial state of FA2 automatically after the final state of FA1
because of:

 Some part of the string maybe accepted by FA2

37. Suppose a language L1 has 2 states and L2 has 2 states. If we have a machine M that accepts
L1 ∩ L2. Then, the total number of states in M is equal to ____________

 4

38. If we have input 110010111 and the machine generates the 001101000 as an output, then that
machine will be called?

 Complementing machine

39. Given the Langusage L = {ab, aa, baa}, which of the following strings are in L*?

1)abaabaaabaa

2)aaaabaaaa

3)baaaaabaaaab

4)baaaaabaa

 1, 2 and 4

http://instructormunir.blogspot.com/ Page 4
40. In the Context of make NFA for the concatenation of FA1 and FA2 (none accepting null
string), which of the following option is correct?

 No Final and initial states in FA1 and FA2 respectively

41. Given S, Kleene star closoure is denoted by ___

 S*

42. when ODD language is expressed by an FA , then it will have minimum_____ states

 two
43. let L be the language of all strings, defined Ʃ={0,1}, ending in 10. which of the following
strings are indistinguishable with respect to L with z being 0?
 111,101
44. keeping in view the discussion by Martin, how many states are required to recognizes the
language of all strings of length 2 or more defined over Ʃ={a,b}, with 'b' being the second
letter from right ?
 7
45. every FA should be__________
 deterministic

46. Let's we have two regular expression R1=(xx+yy) and R2=(x+y). Which on the following is
the correct regular expression for the Union of R1 and R2?

 (xx+yy)+(x+y)

47. If S={ab,bb} then S* will not contain_______

 bbba

48. a(a+b)*b+b(a+b)*a is the regular expression of language defined over Ʃ={a,b} that is

 starting with a and ending in b or starting with b and ending in a

49. What is false about the PALINDROME LANGUAGE?

 FA can be build for it.

50. In FA, final state is represented by a _____ sign.

 +

51. If two finite state machines are equivalent, they should have the same number of ______

http://instructormunir.blogspot.com/ Page 5
 None of these

52. Let S={aa,bb}, the n S* will have the ________ string.

^
53. Which of the following is Not true about the term alphabet?

 It can be an empty set

54. Which of the following is an utility of state elimination phenomenon?

 DFA to regular Expression

55. A _____ with "n" states must accept at least one string of length greater then "n".

 DFA

56. In case of finite automaton there ______ be a transition on each______ for every letter of the
alphabet set.

 must, state

57. _____ can also help in proving Kleene Theorem III.

 NFA

58. Let FA3 be an FA corresponding to FA1FA2, then the initial state of FA3 must correspond to
the final sate of

 FA2 only

59. String x,y,z belongs to Ʃ* such that xz € L but yz € L where LU Ʃ* are:

 Distinguishable

60. In Moore machine, output is produced over the change of:

 States

61. The language of all strings defined over alphabet set={x,y} that ends with different letters
will have the maximum length of:

 infinite

62. An FA is a collection of:

 Finite states, finite transition and finite input letters

http://instructormunir.blogspot.com/ Page 6
63. The language of all strings defined over alphabet set={a,b} that does not end with 'a' actually
ends with:

 b and ^

64. Kleene's Theorem part III expresses the relationship between___________.

 RE and FA

65. Which one of the following machine is represented as a pictorial representation with states
and directed edges labeled by an input letter along with an output character?

 Mealy machine

66. In which of the following machine, the length of output string is the same to that of input
string?

 Mealy machine

67. There is no compulsion that each state must have an on outgoing edge for every input
variable in:

 Transition Graph

68. In Moore machine, if the length of input string is 9, then the length of output string will be:

 10

69. n! will be equal to:

 n*(n+1)!

70. There ______ be dead states in NFA.

 may not

71. While finding RE corresponding to TG, if TG has more than one start state then

 Introduce the new start state

72. In TG, the string is supposed to be ______ if there is no path for a string from initial to final
state.

 Rejected

73. Which of the following from correctly expressed the regular expression RR*?

 R+

http://instructormunir.blogspot.com/ Page 7
74. Reverse of string "YxwzYz" defined over Ʃ={w,x,Y,z} is __________.

 zYzwxY

75. Which of the following is not a step in elimination of states procedure?

 Unify single transition to multi transition that contains union of input

76. Suppose we have an alphabet set having four symbols, how many transition will be there on
each state of a finite automaton for any language defined over the given alphabet?

 4

77. If S={x}, then S* will be_____________.

 {^,x,xx,xxx,xxxx,.....}

78. Kleene's Theorem Part I expresses the relationship between___________.

 FA and TG

79. A string will be accepted by an NFA if there exists __________ one successful path.

 atleast

............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................
............................................................................................................................................................

http://instructormunir.blogspot.com/ Page 8
QUIZ MASTER
Grand Quiz(CS402)
100% correct solution.
For more information you can visit my channel and for
any type of help related to CS619 you can contact me.

YOUTUBE CHANNEL:
https://www.youtube.com/channel/UCINsFwDiB62SValCcPDZbRQ/playlists

FACEBOOK GROUP:
https://www.facebook.com/groups/923887914750307
For More Visit VUStudents.pk

CS402 Solved Grand Quiz 2020


Question No 1
Suppose a language L1 and 2 states and L2 has 2 states. After using the cross product
construction method, we have a machine M that accepts L1 L2. The total number of states in M
Select Correct Option
✓ 2
✓ 4…………………(For More Visit VUStudents.pk)
✓ 6
✓ 8

Question No 2
Let FA1 accepts many strings and FA2 accepts none then FA1+FA2 will be equal to:
Select Correct Option
✓ FA1…………………(For More Visit VUStudents.pk)
✓ FA2
✓ FA2-FA1
✓ (FA2)*

Question No 3
Which one of the following word is not accepted by the regular expression (a+b)*(aa)(a+b)*?
Select Correct Option
✓ aaaa
✓ baaa
✓ aa
✓ bab…………………(For More Visit VUStudents.pk)

Question No 4
There ____________ a language for which only FA can be built but not the RE.
Select Correct Option
✓ is
✓ cannot be…………………(For More Visit VUStudents.pk)
✓ may be
✓ may not be

For More Visit VUStudents.pk


For More Visit VUStudents.pk
Question No 5
What is false about the PALINDROME LANGUAGE?
Select Correct Option
✓ Every word is reverse of itself
✓ It is an infinite language…………………(For More Visit VUStudents.pk)
✓ FA can be build for it
✓ None of the given option

Question No 6
If r1 and r3 are regular expressions then (r1 * r2) is a / an ________________.
Select Correct Option
✓ FA
✓ TG
✓ GTG
✓ Regular expression…………………(For More Visit VUStudents.pk)

Question No 7
The minimum length of the strings(except null string) of a language that starts and ends in
different letters will be:
Select Correct Option
✓ 1
✓ 2
✓ 3…………………(For More Visit VUStudents.pk)
✓ 4

Question No 8
In an FA, when there is no path starting from initial state and ending in final state then that FA
_____________.
Select Correct Option
✓ Accept null string
✓ Accept all string
✓ Accept all non empty strings
✓ Does not accept any string…………………(For More Visit VUStudents.pk)

For More Visit VUStudents.pk


For More Visit VUStudents.pk
Question No 9
Kleene’s Theorem Part 3 expresses the relationship between ____________.
Select Correct Option
✓ FA and TG
✓ TG and RE
✓ RE and FA…………………(For More Visit VUStudents.pk)
✓ FA and RE

Question No 10
Which one of the following is a correct word produced by the RE (a*b)ab?
Select Correct Option
✓ aaaa
✓ bbbb
✓ abab…………………(For More Visit VUStudents.pk)
✓ Null

Question No 11
If L1’ and L2’ are regular languages, then L1,L2 will be
Select Correct Option
✓ Regular…………………(For More Visit VUStudents.pk)
✓ Non regular
✓ May be regular
✓ None of the mentioned

Question No 12
In case of finite automation there, _______ be a transition on each ______ for every letter of the
alphabet set.
Select Correct Option
✓ Must, state…………………(For More Visit VUStudents.pk)
✓ May be, state
✓ Often, edge
✓ Must, edge

For More Visit VUStudents.pk


For More Visit VUStudents.pk
Question No 13
Formal is also known as ________________________.
Select Correct Option
✓ Syntactic language…………………(For More Visit VUStudents.pk)
✓ Semantic language
✓ Informal language
✓ None of these

Question No 14
There __________ be a unique path for each valid string (called a word) in NFA.
Select Correct Option
✓ Must
✓ May not…………………(For More Visit VUStudents.pk)
✓ Should not
✓ Will

Question No 15
Fa is also called
Select Correct Option
✓ TG
✓ GTG
✓ NFA
✓ DFA…………………(For More Visit VUStudents.pk)

Question No 16
While finding RE corresponding to a TG, we connect the new state with the old start state by
_________ transition.
Select Correct Option
✓ a
✓ b
✓ null…………………(For More Visit VUStudents.pk)
✓ RE

For More Visit VUStudents.pk


For More Visit VUStudents.pk
Question No 17
Choose the correct word produced by RE (a + b)*ab.
Select Correct Option
✓ abb
✓ abab…………………(For More Visit VUStudents.pk)
✓ bbbb
✓ aaaa

Question No 18
While developing NFA for the union of FA1 and FA2, there will be _________
transition/transitions for both ‘a’ and ‘b’ on the new initial state.
Select Correct Option
✓ Single
✓ Only one
✓ Only three
✓ Multiple…………………(For More Visit VUStudents.pk)

Question No 19
If two RE’s generate same language then these RE’s are called ___________.
Select Correct Option
✓ Same RE
✓ Equal RE
✓ Similar RE
✓ Equivalent RE…………………(For More Visit VUStudents.pk)

Question No 20
Which of the following is an utility of state elimination phenomenon?
Select Correct Option
✓ DFA to NFA
✓ NFA to DFA
✓ DFA to Regular Expression…………………(For More Visit VUStudents.pk)
✓ All of the mentioned

For More Visit VUStudents.pk


For More Visit VUStudents.pk
Question No 21
Which of the following is the minimal number of states for a finite automation accepting the
language of all strings defined over any alphabet set?
Select Correct Option
✓ 1…………………(For More Visit VUStudents.pk)
✓ 2
✓ 3
✓ 4

Question No 22
The language having even number of a’s and even number of b’s defined over S = {a, b} is
called__________________.
Select Correct Option
✓ EVEN-EVEN…………………(For More Visit VUStudents.pk)
✓ ODD-ODD
✓ PALINDROME
✓ FACTORIAL

Question No 23
FA stands for ________________.
Select Correct Option
✓ Finite Automation…………………(For More Visit VUStudents.pk)
✓ Fixed Automation
✓ False Automation
✓ Functional Automation

Question No 24
When ODD language is expressed by an FA, then it will have minimum ___________ states
Select Correct Option
✓ One
✓ Two…………………(For More Visit VUStudents.pk)
✓ Three
✓ Four

For More Visit VUStudents.pk


For More Visit VUStudents.pk
Question No 25
If FA1 corresponds to (a+b)* then FA1 must accept __________ string/strings.
Select Correct Option
✓ No
✓ Odd length
✓ Even length
✓ Every…………………(For More Visit VUStudents.pk)

Question No 26
Which one of the following word is not accepted by the given regular expression?
Select Correct Option
✓ aaabab
✓ aaaababb
✓ abbaab…………………(For More Visit VUStudents.pk)
✓ aabbabb

Question No 27
Which of the following doesn’t accept any language?
Select Correct Option
✓ Finite state machine
✓ Deterministic finite state machine
✓ Regular expression
✓ Moore machine…………………(For More Visit VUStudents.pk)

Question No 28
Melay machine can have ---------- final states.
Select Correct Option
✓ Zero…………………(For More Visit VUStudents.pk)
✓ One
✓ More than one but finite
✓ More than one but infinite

For More Visit VUStudents.pk


For More Visit VUStudents.pk
Question No 29
How many states of a finite automation will be final for accepting the only string ‘abb’?
Select Correct Option
✓ 1…………………(For More Visit VUStudents.pk)
✓ 2
✓ 3
✓ 4

Question No 30
Null strings can be specified on edges in:
Select Correct Option
✓ Finite Automata
✓ Non-Deterministic Finite Automata
✓ Transition Graph…………………(For More Visit VUStudents.pk)
✓ Melay Machine

THE END
For More Visit VUStudents.pk
CS402- Theory of Automata
Solved Subjective Feb 14,2013
From Final term Papers
MC100401285 Moaaz.pk@gmail.com Mc100401285@gmail.com PSMD01

FINALTERM EXAMINATION
Spring 2012
CS402- Theory of Automata

What is the concept of the Union of FA's ?


Answer:- (Page 32)
FA3 be an FA corresponding to r1+ r2, and then the initial state of FA3 must correspond to the initial state of
FA1 and the initial state of FA2.

What does mean the LANGUAGE IS CLOSED?


Answer:- (Page 90)
Closed w.r.t. concatenation i.e.the language expressed by RE of type r*.

Stack consistence means that in the PDA?


Answer:- (Page 123)
when a row pops a character it should be there at the top of the STACK

-Where Null string is use the most?


Answer:-
The choice of null string depends on the requirements of the language. In some case we need to have null string
to be accepted by the FA.

PUSHDOWN AUTOMATON (PDA)?


Answer:- (Page 119)
PUSHDOWN STACK or PUSHDOWN STORE
PUSHDOWN STACK is a place where the input letters can be placed until these letters are referred again. It
can store as many letters as one can in a long column.
Initially the STACK is supposed to be empty i.e. each of its storage location contains a blank.

1
Prefixes of a language in another language?
Answer:- (Page 78)
Prefixes of a language in another language
If two languages R and Q are given, then the language the prefixes of Q in R denoted by Pref(Q in R) is the set
of strings of letters that, when concatenated to the front of some word in Q to produce some word in R i.e.
Pref(Q in R) = the set of all strings p such that there exists words q in Q and w in R such that pq = w. Following
are the examples in this regard
Example
Let Q = {aa,abaaabb,bbaaaaa,bbbbbbbbbb} and R = {b,bbbb,bbbaaa,bbbaaaaa}
It can be observed that aa and bbaaaaa occur at the ending parts of some words of R, hence these words help in
defining the language pref(Q in R). Thus pref(Q in R) = {b,bbba,bbbaaa}

Conversion form of PDA?


Answer:- (Page 119)
Conversion form of PDA
A PDA is in conversion form if it fulfills the following conditions:
There is only one ACCEPT state.
There are no REJECT states.
Every READ or HERE is followed immediately by a POP i.e. every edge leading out of any READ or HERE
state goes directly into a POP state.
No two POPs exist in a row on the same path without a READ or HERE between them whether or not there are
any intervening PUSH states (i.e. the POP states must be separated by READs or HEREs).
All branching, deterministic or nondeterministic occurs at READ or HERE states, none at POP states and every
edge has only one label.
Even before we get to START, a “bottom of STACK” symbol $ is placed on the STACK. If this symbol is ever
popped in the processing it must be replaced immediately. The STACK is never popped beneath this symbol.
Right before entering ACCEPT this symbol is popped out and left.
The PDA must begin with the sequence

The entire input string must be read before the machine can accept the word.

Is automata is a programming subject or theoretical ??? marks 3


Answer:-
In theoretical computer science, automata theory is the study of mathematical objects called abstract machines
or automata and the computational problems that can be solved using them. Automata mean "self-acting".

Automata theory is also closely related to formal language theory. An automaton is a finite representation of a
formal language that may be an infinite set. Automata are often classified by the class of formal languages they
are able to recognize.

2
Parsing Techniques (5 number)
Answer:- (Page 136)
Recall the CFG for arithmetic expression
S→S+S|S*S|number
It was observed that the word 3+4*5 created ambiguity by considering its value either 23 or 35. To remove this
ambiguity, the CFG was modified to S→(S+S)|(S*S)|number
There arises a question that whether a new CFG can be defined without having parentheses with operator
hierarchy (i.e. * before +)? The answer is yes. Following is the required PLUS'TIMES grammar S→E,
E→T+E|T, T→F*T|F, F→(E)|i
Where i stands for any identifier i.e. number or of storage location name (variable). Following is the derivation
of i+i*i
S ⇒E
⇒T+E

⇒F+E
⇒i+E

⇒i+T
⇒i+F*T

⇒i+i*T
⇒i+i*F
⇒i+i*i

-What are live and dead productions. (5 number)


Answer:- (Page 127)
Live production: A production of the form nonterminal → string of two nonterminals is called a live
production.
Dead production: A production of the form nonterminal → terminal is called a dead production.

FINALTERM EXAMINATION
Spring 2012
CS402- Theory of Automata

1: How can we define languages elaborate any five ways.


Answer:- (Page 4)
Defining Languages
The languages can be defined in different ways , such as Descriptive definition, Recursive definition, using
Regular Expressions (RE) and using Finite Automaton (FA) etc.

3
2: Describe the POP operation and draw symbol for POP state in context of Push down stack.
Answer:- (Page 107)
POP :
POP is an operation that takes out a letter from the top of the STACK. The rest of the letters are moved one
location up. POP state is expressed as

3: Write two difference and two similarities between DFA and NFA.
Answer:- Click here for detail
Difference
1-In FA Finite number of states, having one initial and some (maybe none) final states. While in NFA Finite
many states with one initial and some final state. 2-In FA for each state and for each input letter there is a
transition showing how to move from one state to another while in NFA there may be more than one transition
for certain letters and there may not be any transition for certain letters. 3-In FA  is valid while in NFA  is
not valid.

Common
Every Language that can be recognized by a DFA can also be recognized by a NFA. The reverse is True.
Both DFA and NFA can only have one start state. But they can have multiple Final states.
Finite set of input letters

FINALTERM EXAMINATION
Spring 2012
CS402- Theory of Automata

1. Concept of unit production in CFG? [3 marks]


Answer:- (Page 100)
2. The productions of the form nonterminal → one nonterminal, is called the unit production.
3. Unit production is removed in CFG

4.

4
5. While converting mealy to Moore num of states remain same or not? justify [5]
Answer:- (Page 61)
6. Theorem
7. Statement
8. For every Mealy machine there is a Moore machine that is equivalent to it (ignoring the extra character printed
the Moore machine).
9.
10. Proof
11. Let M be a Mealy machine. At each state there are two possibilities for incoming transitions
12. The incoming transitions have the same output character.
13. The incoming transitions have different output characters.
14. If all the transitions have same output characters, then shift that character to the corresponding state.
15.
16. If all the transitions have different output characters, then the state will be converted to as many states as the
number of different output characters for these transitions, which shows that if this happens at state q then q
will be converted to qi1 and qi2 i.e. if at qi there are the transitions with two output characters then qi1 for one
character and q2 for other character.
17.
18. Shift the output characters of the transitions to the corresponding new states qi and qi. Moreover, these new
states q1 and q2 should behave like q as well. Continuing the process, the machine thus obtained, will be a
Moore machine equivalent to Mealy machine M.
19.

FINALTERM EXAMINATION
Spring 2012
CS402- Theory of Automata

Consider the language L which is EVEN-EVEN, defined over Σ = {a,b}. In how many classes does L
may partition Σ*. Explain briefly.(MArks 3)
Answer:- (Page 77)
Consider the language L which is EVEN'EVEN, defined over Σ = {a,b}. It can be observed that L partitions Σ*
into the following four classes
C1= set of all strings with even number of a’s and odd number of b’s.
C2= set of all strings with odd number of a’s and odd number of b’s.
C3= set of all strings with odd number of a’s and even number of b’s.
C4= set of all strings with even number of a’s and even number of b’s.

Q.3: What does mean the LANGUAGE IS CLOSED?(MArks 3)


Answer:- Rep

5
Q7: If two FA have no final state how the intersection of those FA will have final state? (marks 2)
Answer:- (Page 83)
If Both the FAs have no final state, so these FAs accept nothing. This implies that their union will not also
accept any string. Hence FA corresponding to the language (L1∩ L2c) ∪ ( L1c∩ L2) accepts nothing. Thus
both the languages are equivalent.

Q:8 give RE for EVEN - EVEN language. (Marks 2)


Answer:- (Page 16)
Consider the EVEN) EVEN language, defined over Σ = {a, b}. As discussed earlier that EVEN)EVEN
language can be expressed by the regular expression (aa+bb+(ab+ba)(aa+bb)*(ab+ba))* b

use of push and pop states


Answer:- (Page 107)
A PUSH operator adds a new letter at the top of STACK,
POP is an operation that takes out a letter from the top of the STACK. The rest of the letters are moved one
location up.

FINALTERM EXAMINATION
Spring 2012
CS402- Theory of Automata
1.
2. Write point of kleen's theorem? 2marks
Answer:- (Page 25)
3. Kleene’s Theorem
4. If a language can be expressed by
5. FA or
6. TG or
7. RE
8. Then it can also be expressed by other two as well.
9. It may be noted that the theorem is proved, proving the following three parts
10.
Kleene’s Theorem Part I
If a language can be accepted by an FA then it can be accepted by a TG as well.
Kleene’s Theorem Part II
If a language can be accepted by a TG then it can be expressed by an RE as well.
Kleene’s Theorem Part III
If a language can be expressed by a RE then it can be accepted by an FA as well.

6
What is meant by decidable problem? 2marks
Answer:- (Page 80)
11. Decidable problem
12. A problem that has decision procedure is called decidable problem e.g. the following problems
13. The two regular expressions define the same language.
14. The two FAs are equivalent.

5. Define strings. With example. 3marks


Answer:- (Page 3)
6. Concatenation of finite number of letters from the alphabet is called a string.
7.
Write regular expression contain even words defined over sigma={a, b} 3marks
Answer:- (Page 9)
((a+b)(a+b))*

Find Pref (Q in R) for:


Q = {10, 11, 00, 010}
R = {01001, 10010, 0110, 10101, 01100, 001010} 3 marks
9. Answer:-
10. Pref (Q in R) ={10,01,011,001}

Explain Semi word and word with example?


Answer:- (Page 97)
Semiword
A semiword is a string of terminals (may be none) concatenated with exactly one nonterminal on the right i.e. a
semiword, in general, is of the following form
(terminal)(terminal)… (terminal)(nonterminal)
S→aaaaS

word
A word is a string of terminals. Λ is also a word.
S→aaaa

a) Write RE defined over Σ ={a, b} strings not ending on aa, ab. 5marks
Answer:-
(a+b)*(ba+bb)

b) Write RE defined over Σ = {a, b} strings must end on aa,ab


Answer:-
(a+b)*(aa+ab)

7
8. What does mean the LANGUAGE IS CLOSED? 3marks
Answer:- Rep

Explain CFG and even-even language. 5marks


Answer:- (Page 87-90)
CFG
CFG is a collection of the followings
An alphabet Σ of letters called terminals from which the strings are formed, that will be the words of the
language.
A set of symbols called non-terminals, one of which is S, stands for “start here”.
A finite set of productions of the form
Non-terminal → finite string of terminals and /or non-terminals.
Following grammar generates EVEN-EVEN language.
Σ = {a,b}
productions:
S → SS
S → XS
S→Λ
S → YSY
X → aa
X → bb
Y → ab
Y → ba

OR

Consider the following CFG


S → aaS|bbS|abX|baX|Λ
X → aaX|bbX|abS|baS,
The corresponding language is EVEN-EVEN.

Differentiate b/w FA, TG and GTG?


Answer:-
FA
A Finite automaton (FA), is a collection of the followings
Finite number of states, having one initial and some (maybe none) final states.
Finite set of input letters (Σ) from which input strings are formed.
Finite set of transitions i.e. for each state and for each input letter there is a transition showing how to move
from one state to another.

8
TG
A Transition graph (TG), is a collection of the followings
Finite number of states, at least one of which is start state and some (maybe none) final states.
Finite set of input letters (Σ) from which input strings are formed.
Finite set of transitions that show how to go from one state to another based on reading specified substrings of
input letters, possibly even the null string (Λ).

GTG
A generalized transition graph (GTG) is a collection of three things
Finite number of states, at least one of which is start state and some (maybe none) final states.
Finite set of input letters (Σ) from which input strings are formed.
Directed edges connecting some pair of states labeled with regular expression.
It may be noted that in GTG, the labels of transition edges are corresponding regular expressions

FINALTERM EXAMINATION
Fall 2011
CS402- Theory of Automata

1. Can we accept the string going from final to initial state?


Answer:- (Page 81)
NO…
To examine whether a certain FA accepts any words, it is required to seek the paths from initial to final state.

2. State uses of PDA in computing?


Answer:-
It provides theoretical basis for how computing machine can perform computation. It is uses for constructing
compiler parser design.

3. if there is no initial state in FA then that FA does not accept any language Discuss two situations when
an FA does not accept any string not even the null string?
Answer:- (Page 15)

In FA2, there is no final state and in FA3, there is a final state but FA3 is disconnected as the states 2 and 3 are
disconnected.
9
4. Describe pop operation?and draw symbol for pop state in contex of push down stack?
Answer:- Rep

5. Describe unit production in detail?


Answer:- Rep

6. Push and pop operation?


Answer:- Rep

7. Prove kleens theorem part two?


Answer:- (Page 25)
Kleene’s Theorem Part II
If a language can be accepted by a TG then it can be expressed by an RE as well.

11. 8. Difference between push down stack and push down store?
Answer:- (Page 107)
There is no difference between PUSHDOWN STACK or PUSHDOWN STORE
PUSHDOWN STACK is a place where the input letters can be placed until these letters are referred again. It
can store as many letters as one can in a long column.
Initially the STACK is supposed to be empty i.e. each of its storage location contains a blank.

9. calculate this tree

Answer:- (Page 95)


It can be written as *+*+1 2+3 4 7 6)
The above arithmetic expression in (o'o'o) form can be calculated as
*+*+1 2+3 4 7 6 = *+*3+3 4 7 6
= *+*3 7 7 6 = *+21 7 6 = *28 6 = 168

10
10. Five conditions of PDA conversion?
Answer:- (Page 119)
A PDA is in conversion form if it fulfills the following conditions:
There is only one ACCEPT state.
There are no REJECT states.
Every READ or HERE is followed immediately by a POP i.e. every edge leading out of any READ or HERE
state goes directly into a POP state.
No two POPs exist in a row on the same path without a READ or HERE between them whether or not there are
any intervening PUSH states (i.e. the POP states must be separated by READs or HEREs).
All branching, deterministic or nondeterministic occurs at READ or HERE states, none at POP states and every
edge has only one label.

FINALTERM EXAMINATION
Fall 2011
CS402- Theory of Automata

Q1: what is POP stake and draw it diagram.


Answer:- Rep

Q6 : Consider the following CFG


S aXb|bXa
XaX|bX|
What does it mean?
Answer:- (Page 91)
The above CFG generates the language of strings, defined over ={a,b}, beginning and ending in different
letters.

Q7: Explain Distinguishable strings and Indistinguishable strings?


Answer:- (Page 53)

11
FINALTERM EXAMINATION
Fall 2011
CS402- Theory of Automata

1. What is Row Language?


Answer:- (Page 123)
Row language whose alphabet is Σ = {Row1, Row2, …, Row7} i.e. the alphabet consists of the letters which
are the names of the rows in the summary table.

2. What does FA stands for?


Answer:- (Page 11)
Finite Automaton

3. What are live and dead productions.


Answer:- (Page 123)
Live production: A production of the form nonterminal → string of two nonterminals is called a live
production.
Dead production: A production of the form nonterminal → terminal is called a dead production.

4. What do you mean by wanted and unwanted branches?


Answer:- (Page 137)
wanted branches ( the branches that lead to the required word)
unwanted branches ( the branches that don't lead to the required word)

5.Given the CFG, had to write the language (EQUAL)


Answer:- (Page )
Σ = {a,b}
productions:
S → aB
S → bA
A→a
A → aS
A → bAA
B→b
B → bS
B → aBB
This grammar generates the language EQUAL(The language of strings, with number of a’s equal to number
of b’s).

12
6. Construct corresponding CFG for the given language
(1) All words of even length but not multiple of 3.

Answer(page 90)
Example
∑ = {a,b}
productions:
S → SS
S → XS
S→Λ
S → YSY
X → aa
X → bb
Y → ab
Y → ba
This grammar generates EVEN'EVEN language.

(2) Palindrome (both even and odd palindrome). (5 mark)


Answer(page 91)
Example
The CFG for odd length of Palindrom is given as:

S → aSa | bSb | a | b
The CFG for even length of Palindrom is given as:
S → aSa | bSb | aa | bb | ^

7.Who invented Turing m/c


Answer:- (Page 140)
Alan Mathison Turing developed the machines called Turing machines.

8.Equivalent /non-equivalent langages


Answer:- (Page 80)

13
9. What are formal languages?
Answer:- (Page 3)
Formal Languages are Syntactic languages.

FINALTERM EXAMINATION
Fall 2011
CS402- Theory of Automata

What is Transition?
Answer:- (Page 11)
Transition showing how to move from one state to another.

 Alternative form of this production
Σ = {a,b}
productions:
S→aS| bS |a|b| Λ
Answer:- (Page 88)
This grammar also defines the language expressed by (a+b)*.

 What is input Tap?
Answer:- (Page 105)
The part of an FA, where the input string is placed before it is run, is called the input TAPE.
The input TAPE is supposed to accommodate all possible strings. The input TAPE is partitioned with cells, so
that each letter of the input string can be placed in each cell.

 What is live production?
Answer:- Rep

 Differentiate between Distinguishable and Indistinguishable strings.


Answer:- Rep

 What is wanted and unwanted branches
Answer:- Rep

What is unit of production?
Answer:- Rep

14
Define two rules ………………(Row Language.).
Answer:- (Page 125)
Following are the three rules of defining all possible productions of CFG of the row language
The trip starting from START state and ending in ACCEPT state with the NET style
Net(START, ACCEPT, $) gives the production of the form S → Net(START, ACCEPT, $)

 (L1UL2C) intersection (L1CU L2) the language or accept any thing or not…
Answer:- (Page 80)
(L1 ∩ L2c ) ∪ ( L1c ∩ L2 ) is regular language that accepts the words which are in L1 but not in L2 or else in
L2 but not in L1 .

FINALTERM EXAMINATION
Spring 2011
CS402- Theory of Automata

ambiguous grammer,
Answer:- (Page 95)
The CFG is said to be ambiguous if there exists atleast one word of it’s language that can be generated by the
different production trees.

Difference between semi-word and word with example?


Answer:- Rep

1. If there are more than one edges between two states then we can replace them by one edge in a TG.
Explain it with examples?
Answer:- (Page 27)
If a state has two (more than one) incoming transition edges labeled by the corresponding REs, from the same
state (including the possibility of loops at a state), then replace all these transition edges with a single transition
edge labeled by the sum of corresponding REs.

2.

15
3. How can you say that two FAs are equivalent?
Answer:- (Page 15)
It is to be noted that two FAs are said to be equivalent, if they accept the same language
5.
6. What is a production?
Answer: - (Page 87)
Productions: The grammatical rules are often called productions.

FINALTERM EXAMINATION
Spring 2011
CS402- Theory of Automata

If L1,L2 and L3 be any three finite languages over Sigma = {a,b}, then how will be
(L1 ∩ L2) ∪ ( L2 ∩ L3 ) ≠ Ø
Answer: -
(L1 ∩ L2) ∪ ( L2 ∩ L3 ) ≠ Ø is not always true. It depends on all the languages. If L1 has some common
words with L2 or L2 has some common words with L3, then this will not be equal to empty. However if L1
does not have common words with L2 or L2 does not have common words with L3 then this statement will be
wrong.

FINALTERM EXAMINATION
Spring 2011
CS402- Theory of Automata

two different method for converting the NFA to FA 5marks


Answer: - (Page 43)
Method 1: Since an NFA can be considered to be a TG as well, so a RE corresponding to the given NFA can
be determined (using Kleene’s theorem). Again using the methods discussed in the proof of Kleene’s
theorem, an FA can be built corresponding to that RE. Hence for a given NFA, an FA can be built equivalent to
the NFA

Method 2: Since in an NFA, there may be more than one transition for a certain letter and there may not be any
transition for certain letter, so starting from the initial state corresponding to the initial state of given NFA, the
transition diagram of the corresponding FA, can be built introducing an empty state for a letter having no
transition at certain state and a state corresponding to the combination of states, for a letter having more than
one transitions

16
Explain the decidability and examples. 5marks
Answer: - (Page 80)
Decidability
Effectively solvable problem
A problem is said to be effectively solvable if there exists an algorithm that provides the solution in finite
number of steps e.g. finding solution for quadratic equation is effectively solvable problem, because the
quadratic formula provides an algorithm that determines the solution in a finite number of arithmetic
operations, (four multiplications, two subtractions, one square root and one division).

similarity and dif b/w DFA and NFA 3 marks


Answer: - Rep

RE for Even-even 2 marks


Answer: - (Page 10)
(aa+bb+(ab+ba)(aa+bb)*(ab+ba))*

FINALTERM EXAMINATION
Fall 2010
CS402- Theory of Automata

Question No: 27 ( Marks: 2 )


Differentiate between Regular and Non regular languages?
Answer: - (Page 10 & 71)
The language generated by any regular expression is called a regular language.
The language that cannot be expressed by any regular expression is called a Nonregular language.

Question No: 28 ( Marks: 2 )


What is meant by a "Transition" in FA?
Answer: - Rep

Question No: 29 ( Marks: 2 )


What are the halt states of PDAs?
Answer: - (Page 105)
ACCEPT and REJECT states are called the halt states.
1. Reject state is like dead non final state.
2. Accept state is like final state.

17
Question No: 30 ( Marks: 2 )
Identify the null productions and nullable productions from the following CFG:
S -> ABAB
A -> a | /\
B-> b | /\
Answer: - (Page 102)
Here S → ABAB is nullable production and A → Λ, B → Λ are null productions.

Question No: 31 ( Marks: 3 )


Describe the POP operation and draw symbol for POP state in context of Push down stack.
Answer: - Rep

Question No: 32 ( Marks: 3 )


What does the the following tape of turing machine show?

Answer: - (Page 124)


Row11 is not Net style sentence because the trip from READ9 to READ3 does not pop one letter form the
STACK, while it adds two letters to the STACK. However Row11 can be concatenated with some other Net
style sentences e.g. Row11Net(READ3, READ7, a)Net(READ7, READ1, b)Net(READ1, READ8, b) Which
gives the nonterminal.
Net(READ9, READ8, b), now the whole process can be written as
Net(READ9, READ8, b) → Row11Net(READ3, READ7,a) Net(READ7, READ1, b)Net(READ1, READ8, b)
Which will be a production in the CFG of the corresponding row language.

Question No: 33 ( Marks: 3 )


Find Pref (Q in R) for:
Q = {10, 11, 00, 010}
R = {01001, 10010, 0110, 10101, 01100, 001010}
Answer: - Rep

Question No: 35 ( Marks: 5 )


Consider the language L which is EVEN-EVEN, defined over Σ = {a,b}. In how many classes does L may
partition Σ*. Explain briefly.
Answer: - Rep
Question No: 36 ( Marks: 5 )
What are the conditions (any five) that must be met to know that PDA is in conversion form?
Answer: - Rep

18
AL-JUNAID INSTITUTE GROUP

LMS handling service are


available
PAID
Assignment, QUIZ, GDBZ and
GRAND QUIZ SERVICE are
available
0304-1659294

MUHAMMAD JUNAID
0304-1659294
Bc190202640@vu.edu.pk
AL-JUNAID INSTITUTE GROUP
CS402 GRAND QUIZ
Sr.N MCQS ANSWE
o R
1. Which of the following steps replaces multiple Step 3
incoming transition edges with a single one
proving Kleene’s theorem part II?
2. Let FA1 accepts many strings and FA2 accepts FA1
no strings, then FA1+FA2 will be equal to:
3. Let L be the language of all strings, defined over (010,101)
∑ =(0,1), ending in 10. Which of the following
strings are indistinguishable w.r.t L with z being
0?
4. If r1=(aa+bb)and r2=(a+b) then the language (r)(r2)
(aa+bb)(a+b) will bhe generated by_______
5. Introducing a new start state in the case of 1
multiple states is step no.______ of proving
Kleen’s theorem part II.
6. The language having even numbers of a’s and EVEN-EVEN
even number of b’s defined over S={a,b} is
called ______
7. In NFA having no transition at a certain state, FA Empty state
can be built by introducing :
8. For every three regular expression R, S, and T. Same
the language denoted by R(S U T) and
(RS)U(RT) are the _______
9. Which of the following string belongs to the aabaab
language of the regular expression (aa*b)?
10. If L1’ and L2’ are regular languages, then L1, L2 Regular
will be
11. Suppose the language L1 has 2 L2 has 2 states. If 4
we have a machine M that accepts L1∩L2. Then
the total number of states in M is equal
to_______
AL-JUNAID INSTITUTE GROUP
12. If L is a regular language, then (L’)’ U L will be: L
13. In Mealy machine, the output depends on______ Present state
and Present
output
14. Strings x,y,z belongs to ∑* such that xz ∈ L but Distinguishabl
yz ∉ L where L ⊆ ∑* are: e
15. Melay machine to increase the output string in Incrementing
magnitude by 1 is called: machine
16. Suppose we have FA3 (which is to FA1+FA2) It corresponds
then the final state of FA3 will be declared final to any of the
if: final states of
FA1 or FA2
17. If we have the finite language and the number of n+1
states in the FA is n then the maximum number
of letter in each word of the language that will be
accepted by the given FA will be :
18. Which of the following state is introduced while An initial
developing NFA for the closure of FA? state which
should be
final as well
19. Length of EVEN-EVEN language is_______ Even
20. If FA1 corresponds to (a+b)* then FA1 must Every
accept_______ strings/strings.
21. In FA, initial stage is represented by : Drawing an
arrowhead
before the
state
22. Which one of the following machine is Mealy
represented as a pictorial representation with machine
states and directed edges labeled by an input
letter along with an output character?
23. Length of machine “AbBAbcd“ defined over Five
∑=(Ab,B,c,d) is_______.
24. An FA is a collection of: Finite states ,
finite
transition and
finite input
AL-JUNAID INSTITUTE GROUP
letter
25. Given the language L={ab, aa, baa}, which of the 1,2 & 4
following strings are in L*?
i) abaabaaabaa
ii) aaaabaaaa
iii)baaaaabaaaab
iv)baaaaabaa
26. In the context to make NFA for the concentration Final states in
of FA1 and FA2 (FA1 accepting null string) both FAs
which of the following option is correct?
27. Every ___ is a ___ as well, but the converse may FA, TG
not be true.
28. NFA with null string has ____ initial state(s). One
29. While finding RE corresponding to a TG, we Null
connect the new start state with the old start state
by____ transition.
30. If S=(x). then S* will be_____. {^,x,xx,xxx,x
xxx….}
31. The minimum length of string (except null string) 2
of a language that starts and ends in the same
letter will be:
32. If S={ab, bb} , then S* will not contain______. bbba
33. Which of the following machine has only one Moore
initial state? machine
34. Which of the following diagram is very rigid in FA
order to express any language?
35. Let L be the language of all strings, defined over 111,101
∑ =(0,1), ending in 111. Which of the following
strings are indistinguishable w.r.t L with z being
11?
36. Mealy machine can have ______ final states. Zero
37. In Moore machine , output is produced over the States
change of:
38. Lets we have two regular expressions R1 (xx+yy)+
={xx+yy}and R2={x+y} . Which one of the (x+y)
following is the correct regular expression for the
union of R1 and R2?
AL-JUNAID INSTITUTE GROUP
39. FA corresponding to an NFA can be built by No transition
introducing a state corresponding to the at certain state
combination of states, for a letter having
40. The situation there is no way to leave after entry Davey john
is called locker
41. Which one of the following word is not accepted Abbaab
by the given regular expression?
42. According to the theory of automata, there are Two
________ types of languages.
43. Which of the following word is not accepted by Baabaabba
the given regular expression?
44. Regular languages are closed under the following Union,
operations. Concentration
, Closure
45. There can be more than ____ FA for a certain One, one
language but for ____FA there is only one
language associated with it.
46. There is no compulsion that each state must have Transition
an on outdoing edge for every input variable in: graph
47. FA is also called_____. DFA
48. If r1 and r2 are regular expressions then (r1*r2) RE (Regular
is______ expression)

49. Which of the following is the minimal number of 1


states for a finite automaton accepting the
language of all strings defined over any alphabet
set?
50. Keeping view language of all strings ending with A
‘a’ for which symbol we will take a loop on the
final state of its transition diagram?
51. Which of the following statements is true about Transition of
NFA with Null String? null string is
allowed in
any stage
52. Which one of the following diagrams expresses GTG
languages more simply?
53. The language of all strings defined over alphabet a and ^
AL-JUNAID INSTITUTE GROUP
set={a,b} that does not end with ‘a’ actually end
with:
54. Let S={aa,bb}, then S* will have the _____ ^
string.
55. Formal is also known as_____. Syntactic
language
56. There may be more than one transition for a Non-
certain letter on a state in: Deterministic
finite
automata
57. A loop at a state is supposed to be_____transition Incoming
while converting Moore machine into an
equivalent Maley machine.
58. FA of EVEN language shows null string initial state is
when______. final as well
59. Which of the following statement is true about Transitions
GTG? are based on
regular
expressions
60. Which of the following machine has only one Moore
initial state and no final state? machine
61. In GTG, there can be more than one : Start state and
final state
62. GTG for the expression (aa+aba)* may have 1
minimum number of states.
63. In regular expression, the operator ‘*’ stands for. Iteration
64. If we have only one state having no transition for NFA
input letters, then it is an example of:
65. If A and B are regular languages, !(A’U B’) is: Regular
66. A ________ with “n” states must accept least one DFA
string of length greater than “n”.
67. If r1 is a regular expression then (r1)* is Also a regular
_______. expression
68. Which of the following is the bypass and state 4
elimination step in the context of Kleene’s
theorem part II proof?
69. Which of the following is free of non- FA
AL-JUNAID INSTITUTE GROUP
determinism?
70. There is no question of accepting any language Moore
in: machine
71. A string will be accepted by an NFA if there atleast
exist_______one successful path.
72. Kleene’s theorem part I expresses the FA and TG
relationship between_______
73. Keeping in view the discussion by Martin, how 7
any states are required to recognize the language
of all strings of length 2 or more defined over
∑={a,b} with ’b’ being the second letter from
right?
74. FA and _____ are same excepts that ______has NFA,FA
unique symbol for each transition.
75. Subtraction of binary number is possible through. Both
complementin
g and
incrementing
machine
76. Null strings can be specified on edges in: Transition
graph
77. What is false about the PLAINDROME FA can be
LANGUAGE? build for it
78. While finding RE corresponding to a TG, if TG Introduce the
has more than one start state then. new start state
79. All possible combination of string of a language Kleene star
including null string is referred as. closure of a
language
80. N! will be equal to: n*(n-1)!
81. Every NFA can be considered to be a____ as TG
well, but the converse may not be true.
82. In proving Kleene theorem II , if three statuses Concentration
are connected then middle state is removed bt
connecting first and third and writing
corresponding RE in:
83. In ______ there must be transition for all the FA
letters of the string.
AL-JUNAID INSTITUTE GROUP
84. For a given Moore Machine , the input string is Length of
‘101010’ , thus the output string would be of input string+1
length:
85. The FA can be drawn for the regular expression 1
(a+b)* with minimum________ state(s).
86. Which of the following does not contribute while ^
finding out the length of strings?
87. The language of all strings defined over alphabet Infinite
set ={x,y} that ends with same letters will have
the maximum length of:
88. Considering FA1 and FA2 having 2 states each. More than 3
Now FA1+FA2 can have maximum__________
number of states.
89. Which one of the following is RE for the a(a+b)*
language defined over ∑={a,b} having all the
words starting with a?
90. An ________ can be considered to be an NFA
intermediate structure between finite automaton
and transition graph.
91. In order to make NFA for the union of FA1 and Initial states
FA2, the new initial state should be liked to: of both FAs
92. We cannot construct an NFA for the language of Palindromes
_______ defined over alphabet set{a,b}.
93. The CFG is said to be ambiguous if there exist at More then one
least one word of its language that can be / Different
generated by the ………… production trees
94. What do automata mean? something
that works
automatically
/ “something
are done
automatically
95. According to theory of automata there 2
96. The Minimum length of the string (except bull 1
string) of a language that starts and ends in the
same letters will be:
AL-JUNAID INSTITUTE GROUP
97. If S= {ab,bb} then S* will not contain_________ Bbba
98. Which of the following machines has only one More machine
initial state and no final state?
99. Which of the following diagram is very rigid in FA
order to express any language ?
100. If S={a},then S+will be______ {a,aa ,aaa ,
aaaa…}
101. Let L be the language of the all string defined 010,101
over over∑ ¿ { 0,1 } ending in10. Which of the
following string are indistinguishable with
respect to L with z being 11?
102. Melay machine can have _____final state Zero
103. Given the Language L = {ab, aa,baa},which of 1, 2 and 4
the following string are in L*?
1) Abaabaaaabaa
2) Aaaabaaaa
3) Baaaaabaaaaab
4) baaaaabaa
104. If L1 and L2 are regular Language L1∩(L2 ∪ L1) Regular
will be
105. In Mealy Machine the out put depends Present State
on_______ and present
output
106. There is no question of accepting any language Moore
in. Machine
107. The state where there is no way to leave after Davey john
entry is called___ Locker
108. FA corresponding to an NFA can be built by No transaction
introducing an empty state for a letter having at certain state
109. Which of the following diagram express GTG
language more simply?
110. Automata is the plural of______ Automation
111. If A and B are regular Language !(A∪B) is Regular
112. In NFA having no transition at certain state FA Empty state
can be built by introducing.
AL-JUNAID INSTITUTE GROUP
113. Consuming FA1 and FA2 having 2 STATES 2
each. Now FA1+FA2 can have 3
maximum______number of state More then 3
None of the
given
114. In an FA when there is no path starting from Accept all
initial state and ending state in final state then string
that FA______
115. According to theory of automation there Two
are_____type if language
116. In Moore machine if the length of input string is 10
9 then the length of output string will be.
117. When ODD language is expressed by an FA,then One
it will have minimum ____ state
118. [(a+b)(a+b)]*.given RE contact generate the Bbbbbb
string________
119. Which of the following state is true about GTG? Transection
are based on
regular
expression
120. Every_____is a _____ as will, but the converts FA,TG
may not be true.
121. Which of the following machine is represented as Mealy
a pictorial representation with states and directed Machine
edges labeled by an input letter along with an
output character?
122. The recursive method for defining a language has Three
____ steps
123. Consider the following RE. Aa
A(a+b)b*
All of the following word are accepted
except______
124. Which of the following regular expression 1 and 2
represented same language?
1. (a+ab)*
2. 2(ba+a)*
3. A*(aa*b)*
AL-JUNAID INSTITUTE GROUP
4. (a*b)*
125. For every there regular expression R,S and T the Same
Language denoted by R(S∪T) and (RS)∪(RT) are
the
126. Alphabet S={a,bc,cc} has____number of letters. Three
127. An____can be considered to be an intermediate NFA
structure between Finite automation and
Transition Graph.
128. Two FAs are said to be equivalent if they______ Accept same
language
129. There may be more then one transition for a Finite
certain letter on a state in Automata
130. _____can also help in proving Kleene Theorem NFA
III.
131. Kleene Theorem Part II expression the TG and RE
relationship between____
132. FA corresponding to an NFA can be built by No transition
introducing an empty state for a letter having. at certain state
133. FA is also called DFA
134. If two Res generated same language then these Equivalent RE
Res are called ____
135. We cannot an NFA for the language of ____ Palindromes
defend over alphabet set{a,b}
136. Kleene Theorem Part II expression the RE and FA
relationship between____
137. Let FA3 an FA corresponding to FA1 FA2 then FA1 only
the initial state of FA3 must correspond to the
initial state of
138. Every FA should be___ Deterministic
139. The minimum length of string (except null string) 1
of a language that starts and ends in the different
letter will be:
140. Which of the following will be the final state of Final states of
FA3 obtained from the union of FA1 and FA2? FA1 or FA2
141. In concatenation we accept the initial state of We need just
FA2 automatically after the final state of FA1 one initial
AL-JUNAID INSTITUTE GROUP
because of: state
142. Let FA1 accepts many strings and FA2 accepts FA2-FA1
none then FA1+FA2 will be equal to:
143. Regular
The language {a ab aba bab} is _____ .

144. Tokenizing
Decomposing a string into its valid units is
referred as:
145. FA1 or FA2
Let FA3 be an FA corresponding to FA1+FA2,
then the initial state of FA3 Must corresponds to
the initial state of

146. If FA1 corresponds to (a+b)* then FA1 must EVERY


accept ___________ string/strings.
Select correct option: No Odd length
147. A regular language can be:
irregular
infinite
non-
deterministic
None of the
given options

148. N into its valid units is referred as:


Tokenizing
149. The strings of FA2 are accepted first before the
strings of FA1 Palindromes
150. There ______ a language for which only FA can
be built but not the RE. Be may
151. Kleene's Theorem part I expresses the relationship FA and TG
between ___
Cs402 Quiz
Solved by Rizwan Qadeer (Riz Mughal)
Youtube link:

https://www.youtube.com/channel/UCINsFwDiB62SValCcPDZbRQ/playlists

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy