TOC Part-1
TOC Part-1
Regular Languages and Regular Expressions - Hint: Nodes and Edges are for trees and forests too.
Nondeterministic Finite Automata - Kleene's Which of the following make the correct
Theorem. Minimal Finite Automata-Pumping combination?
Lemma for Regular Languages- Context Free a) Statement 1 is false but Statement 2 and 3 are
Grammars and Languages. Push Down Automata. correct
Turing Machine, Recursively enumerable b) Statement 1 and 2 are correct while 3 is wrong.
Languages, Non-recursive Language, Unsolvable c) None of the mentioned statements are correct.
problems. d) All of the mentioned statements are correct.
Finite Automata-Introduction -
“Finite Automata-Introduction”. Answer: d
1. Assume the R is a relation on a set A, aRb is Explanation: It is possible to represent a finite
partially ordered such that a and b are automaton graphically, with nodes for states, and
_____________ arcs for transitions.
a) reflexive 5. The minimum number of states required to
b) transitive recognize an octal number divisible by 3 are/is
c) symmetric a) 1
d) reflexive and transitive b) 3
c) 5
Answer: d d) 7
Explanation: A partially ordered relation refers to
one which is Reflexive, Transitive and Answer: b
Antisymmetric. Explanation: According to the question, minimum
2. The non- Kleene Star operation accepts the of 3 states are required to recognize an octal
following string of finite length over set A = {0,1} | number divisible by 3.
where string s contains even number of 0 and 1 6. Which of the following is a not a part of 5-tuple
a) 01,0011,010101 finite automata?
b) 0011,11001100 a) Input alphabet
c) ε,0011,11001100 b) Transition function
d) ε,0011,11001100 c) Initial State
d) Output Alphabet
Answer: b
Explanation: The Kleene star of A, denoted by A*, Answer: d
is the set of all strings obtained by concatenating Explanation: A FA can be represented as FA= (Q,
zero or more strings from A. ∑, δ, q0, F) where Q=Finite Set of States, ∑=Finite
3. A regular language over an alphabet ∑ is one Input Alphabet, δ=Transition Function, q0=Initial
that cannot be obtained from the basic languages State, F=Final/Acceptance State).
using the operation 7. If an Infinite language is passed to Machine M,
a) Union the subsidiary which gives a finite solution to the
b) Concatenation infinite input tape is ______________
c) Kleene* a) Compiler
d) All the mentioned b) Interpreter
c) Loader and Linkers
Answer: d d) None of the mentioned.
Explanation: Union, Intersection, Concatenation,
Kleene*, Reverse are all the closure properties of Answer: a
Regular Language. Explanation: A Compiler is used to give a finite
4. Statement 1: A Finite automata can be solution to an infinite phenomenon. Example of an
represented graphically; Statement 2: The nodes infinite phenomenon is Language C, etc.
can be its states; Statement 3: The edges or arcs can
8. The number of elements in the set for the categorize din two parts: Moore M/C and Mealy
Language L={xϵ(∑r) *|length if x is at most 2} and M/C.
∑={0,1} is_________ 2. In Moore machine, output is produced over the
a) 7 change of:
b) 6 a) transitions
c) 8 b) states
d) 5 c) Both
d) None of the mentioned.
Answer: a
Explanation: ∑r= {1,0} and a Kleene* operation Answer: b
would lead to the following Explanation: Moore machine produces an output
set=COUNT{ε,0,1,00,11,01,10} =7. over the change of transition states while mealy
9. For the following change of state in FA, which machine does it so for transitions itself.
of the following codes is an incorrect option? 3. For a give Moore Machine, Given
a) δ (m, 1) =n Input=’101010’, thus the output would be of
b) δ (0, n) =m length:
c) δ (m,0) =ε a) |Input|+1
d) s: accept = false; cin >> char; b) |Input|
if char = “0” goto n; c) |Input-1|
d) Cannot be predicted.
Answer: b
Explanation: δ(QX∑) = Q1 is the correct Answer: a
representation of change of state. Here, δ is called Explanation: Initial state, from which the
the Transition function. operations begin is also initialized with a value.
10. Given: ∑= {a, b} 4. Statement 1: Null string is accepted in Moore
L= {xϵ∑*|x is a string combination} Machine.
∑4 represents which among the following? Statement 2: There are more than 5-Tuples in the
a) {aa, ab, ba, bb} definition of Moore Machine.
b) {aaaa, abab, ε, abaa, aabb} Choose the correct option:
c) {aaa, aab, aba, bbb} a) Statement 1 is true and Statement 2 is true.
d) All the mentioned b) Statement 1 is true while Statement 2 is false.
c) Statement 1 is false while Statement 2 is true.
Answer: b d) Statement 1 and Statement 2, both are false.
Explanation: ∑* represents any combination of the
given set while ∑x represents the set of Answer: a
combinations with length x where x ϵ I. Explanation: Even ε, when passed as an input to
Moore machine produces an output.
. 5. The total number of states and transitions
required to form a moore machine that will produce
Moore Machine - residue mod 3.
“Moore Machine”. a) 3 and 6
1. Moore Machine is an application of: b) 3 and 5
a) Finite automata without input c) 2 and 4
b) Finite automata with output d) 2 and 5
c) Non- Finite automata with output
d) None of the mentioned. Answer: a
Explanation:
Answer: b
Explanation: Finite automaton with an output is
8. The output alphabet can be represented as:
a) δ
b) ∆
c) ∑
d) None of the mentioned
Answer: b
Explanation: Source-The tuple definition of Moore
and mealy machine comprises one new member i.e.
6. Complete the given table according to the given output alphabet as these are finite machines with
Moore machine. output.
9. The O/P of Moore machine can be represented in
the following format:
a) Op(t)=δ(Op(t))
b) Op(t)=δ(Op(t)i(t))
c) Op(t): ∑
Present State d) None of the mentioned
Next State
Output Answer: a
0 Explanation: Op(t)=δ(Op(t)) is the defined
1 definition of how the output is received on giving a
Q0 specific input to Moore machine.
Q1 10. Which of the following is a correct statement?
Q2 a) Moore machine has no accepting states
1 b) Mealy machine has no accepting states
Q1 c) We can convert Mealy to Moore but not vice
Q2 versa
1 d) All of the mentioned
Q2 e) Not all of the mentioned are correct
Q0
a) Q0, Q2, 0 Answer: e
b) Q0, Q2, 1 Explanation: Statement a and b is correct while c is
c) Q1, Q2, 1 false. Finite machines with output have no
d) Q1, Q0, 0 accepting states and can be converted within each
other.
Answer: a
Explanation: The table can be filled accordingly .
seeing the graph.
7. What is the output for the given language? Mealy Machine -
Language: A set of strings over ∑= {a, b} is taken “Mealy Machine”.
as input and it prints 1 as an output “for every 1. In mealy machine, the O/P depends upon?
occurrence of a, b as its substring. (INPUT: abaaab) a) State
a) 0010001 b) Previous State
b) 0101010 c) State and Input
c) 0111010 d) Only Input
d) 0010000
Answer: c
Answer: a Explanation: Definition of Mealy Machine.
Explanation: The outputs are as per the input, 2. Which of the given are correct?
produced. a) Moore machine has 6-tuples
b) Mealy machine has 6-tuples d) Linearly Bounder Automata
c) Both Mealy and Moore has 6-tuples
d) None of the mentioned Answer: b
Explanation: They are collectively known as
Answer: c Transducers.
Explanation: Finite Automaton with Output has a 7. The major difference between Mealy and Moore
common definition for both the categories. machine is about:
3. The following mealy machine outputs which of a) Output Variations
the following? b) Input Variations
c) Both
d) None of the mentioned
Answer: a
Explanation: Mealy and Moore machine vary over
how the outputs depends on prior one (transitions)
and on the latter one(states).
8. Statement 1: Mealy machine reacts faster to
inputs.
a) 9’s Complement Statement 2: Moore machine has more circuit
b) 2’s Complement delays.
c) 1’s Complement Choose the correct option:
d) 10’s Complement a) Statement 1 is true and Statement 2 is true.
b) Statement 1 is true but Statement 2 is false.
Answer: b c) Statement 1 is false and Statement 2 is true.
Explanation: The input can be taken in form of a d) None of the mentioned is true.
binary string and can be verified.
4. The O/P of Mealy machine can be represented in Answer: a
the following format: Explanation: Being an input dependent and output
a) Op(t)= δ(Op(t)) capable FSM, Mealy machine reacts faster to
b) Op(t)= δ(Op(t)i(t)) inputs.
c) Op(t): ∑ 9. Which of the following does the given Mealy
d) None of the mentioned machine represents?
Answer: b
Explanation: The output of mealy machine depends
on the present state as well as the input to that state.
5.The ratio of number of input to the number of
output in a mealy machine can be given as:
a) 1
b) n: n+1
c) n+1: n
d) None of the mentioned a) 9’s Complement
b) 2’s Complement
Answer: a c) 1’s Complement
Explanation: The number of output here follows the d) 10’s Complement
transitions in place of states as in Moore machine.
6. Mealy and Moore machine can be categorized Answer: c
as: Explanation: Inputs can be taken and can be
a) Inducers verified.
b) Transducers 10. Which one among the following is true?
c) Turing Machines A mealy machine
a) produces a language
b) produces a grammar
c) can be converted to NFA
d) has less circuit delays
Answer: d
Explanation: It does not produce a language or a
grammar or can be converted to a NFA.
Mealy Machine-II -
“Mealy Machine-II”.
1. Which of the following does not belong to input
alphabet if S={a, b}* for any language?
a) a 3. An e-NFA is ___________ in representation.
b) b a) Quadruple
c) e b) Quintuple
d) None of the mentioned c) Triple
d) None of the mentioned
Answer: c
Explanation: The automaton may be allowed to Answer: b
change its state without reading the input symbol Explanation: An e-NFA consist of 5 tuples: A=(Q,
using epsilon but this does not mean that epsilon S, d, q0. F)
has become an input symbol. On the contrary, one Note: e is never a member of S.
assumes that the symbol epsilon does not belong to 4. State true or false:
any alphabet. Statement: Both NFA and e-NFA recognize exactly
2. The number of final states we need as per the the same languages.
given language? a) true
Language L: {an| n is even or divisible by 3} b) false
a) 1
b) 2 Answer: a
c) 3 Explanation: e-NFA do come up with a convenient
d) 4 feature but nothing new.They do not extend the
class of languages that can be represented.
Answer: b 5. Design a NFA for the language:
Explanation: L: {an| n is even or divisible by 3}
Which of the following methods can be used to
simulate the same.
a) e-NFA
b) Power Construction Method
c) Both (a) and (b)
d) None of the mentioned
Answer: c
Explanation: It is more convenient to simulate a
machine using e-NFA else the method of Power
Construction is used from the union-closure of
DFA’s.
6. Which of the following belongs to the epsilon
closure set of a?
Answer: a
Explanation: Yes, the language is preserved during
the dteps of construction:
L(N)=L(N1)=L(N2)=L(3).
10. Remove all the epsilon transitions in the given
diagram and compute the number of a-transitions in
the result?
a) 0
b) 1
c) 2
d) 3
Answer: c
Explanation: The epsilon closure set of f2 consist
of the elements:{f2, f3}. Thus the count of the
element in the closure set is 2.
8. Which of the steps are non useful while
eliminating the e-transitions for the given diagram?
Answer: b
Explanation: Bounded information refers to one
whose output is limited and it cannot be said what
were the recorded outputs previously until
memorized.
2. A Language for which no DFA exist is
a________
a) Regular Language
b) Non-Regular Language
c) May be Regular
d) Cannot be said
Answer: b
Explanation: A language for which there is no
a) 5 existence of a deterministic finite automata is
b) 7 always Non Regular and methods like Pumping
c) 9 Lemma can be used to prove the same.
d) 6 3. A DFA cannot be represented in the following
format
Answer: b a) Transition graph
Explanation: b) Transition Table
c) C code
d) None of the mentioned
Answer: d
Explanation: A DFA can be represented in the
following formats: Transition Graph, Transition
Table, Transition tree/forest/Any programming
Language.
4. What the following DFA accepts?
Answer: c
Explanation: Two states are said to be equivalent if
and only if they have same number of states as well
as transitions.
6. What does the following figure most correctly
represents?
a) ε
b) 11010
c) 10001010
a) Final state with loop x
d) String of letter count 11
b) Transitional state with loop x
c) Initial state as well as final state with loop x
Answer: a
d) Insufficient Data
Explanation: As the initial state is not made an
acceptance state, thus ε will not be accepted by the
Answer: c
given DFA. For the automata to accept ε as an
Explanation: The figure represents the initial as
entity, one should make the initial state as also the
well as the final state with an iteration of x.
final state.
7. Which of the following will not be accepted by
9. Can a DFA recognize a palindrome number?
the following DFA?
a) Yes
b) No
c) Yes, with input alphabet as ∑*
d) Can’t be determined
Answer: b
Explanation: Language to accept a palindrome
number or string will be non-regular and thus, its
DFA cannot be obtained. Though, PDA is possible.
10. Which of the following is not an example of
finite state machine system?
a) Control Mechanism of an elevator
a) ababaabaa
b) Combinational Locks
b) abbbaa
c) Traffic Lights
c) abbbaabb
d) Digital Watches
d) abbaabbaa
Answer: d
Answer: a
Explanation: Proper and sequential combination of
Explanation: All the Strings are getting accepted
events leads the machines to work in hand which
except ‘ababaabaa’ as it is directed to dumping
includes The elevator, Combinational Locks,
Traffic Lights, vending machine, etc. Other substring 11}
applications of Finite machine state system are
Communication Protocol Design, Artificial Answer: b
Intelligence Research, A Turnstile, etc. Explanation: The Language can be anonymously
checked and thus the answer can be predicted. The
To practice all areas of Automata Theory for language needs to be accepted by the automata
Interviews, . (acceptance state) in order to prove its regularity.
3. Let ∑= {a, b, …. z} and A = {Hello, World}, B=
DFA Processing Strings - {Input, Output}, then (A*∩B) U (B*∩A) can be
“DFA Processing Strings”. represented as:
1. The password to the admins a) {Hello, World, Input, Output, ε}
account=”administrator”. The total number of b) {Hello, World, ε}
states required to make a password-pass system c) {Input, Output, ε}
using DFA would be __________ d) {}
a) 14 states
b) 13 states Answer: d
c) 12 states Explanation: Union operation creates the universal
d) A password pass system cannot be created using set by combining all the elements of first and
DFA second set while intersection operation creates a set
of common elements of the first and the second
Answer: a state.
Explanation: For a string of n characters with no 4. Let the given DFA consist of x states. Find x-y
repetitive substrings, the number of states required such that y is the number of states on minimization
to pass the string is n+1. of DFA?
2. Which of the following is the corresponding
Language to the given DFA?
a) 3
b) 2
c) 1
d) 4
Answer: b
Explanation: Use the equivalence theorem or
Myphill Nerode theorem to minimize the DFA.
5. For a machine to surpass all the letters of
alphabet excluding vowels, how many number of
states in DFA would be required?
a) L= {x ϵ {0, 1} * | x ends in 1 and does not a) 3
contain substring 01} b) 2
b) L= {x ϵ {0,1} * |x ends in 1 and does not contain c) 22
substring 00} d) 27
c) L= {x ϵ {0,1} |x ends in 1 and does not contain
substring 00} Answer: a
d) L= {x ϵ {0,1} * |x ends in 1 and does not contain Explanation:
string.
b) Regularity is not dependent upon the length of
the string.
c) Can’t be said for a particular string of a
language.
d) It may depend on the length of the string.
Answer: b
Explanation: DFA can be made for infinite
language with an infinite length. Thus, dependency
over length is unfruitful.
8. Given:
L= {xϵ∑= {0,1} |x=0n1n for n>=1}; Can there be a
DFA possible for the language?
a) Yes
b) No
6. For the DFA given below compute the
following: Answer: b
Union of all possible combinations at state 7,8 and Explanation: It is not possible to have a count of
9. equal number of 0 and 1 at any instant in DFA.
Thus, It is not possible to build a DFA for the given
Language.
9. δ(A,1) = B, δ(A,0) =A
Δ (B, (0,1)) =C
δ(C,0) = A (Initial state =A)
String=”011001” is transit at which of the states?
a) A
b) C
c) B
d) Invalid String
Answer: a
Explanation: It is east and simple to create the table
and then the corresponding transition graph in order
to get the result, at which state the given string
would be accepted.
Answer: a
Explanation: The states transited has been written
corresponding to the transitions as per the row and
a) Q0
column. The row represents the transitions made
b) Q1
and the ultimate.
c) Q2
2.Let u=’1101’, v=’0001’, then uv=11010001 and
d) No Transition
vu= 00011101.Using the given information what is
the identity element for the string?
Answer: Q1
a) u-1
Explanation: The tabular representation of DFA is
b) v-1
quite readable and can be used to some ore
c) u-1v-1
complex problems. Here, we need to form the
d) ε
transition graph and fill up the given blank.
Answer: d
6.Which among the following is the missing
Explanation: Identity relation: εw = wε = w, thus
transition in the given DFA?
the one satisfying the given relation will be the
L= {xϵ∑= {a, b} | x starts with a and ends with b}
identity element.
3.Which of the following substring will the
following notation result?
a) 0101011
b) 0101010
c) 010100
d) 100001
Answer: c
Explanation: The given DFA notation accepts the
string of even length and prefix ‘01’.
4.Predict the following step in the given bunch of a) δ (q0, a) =q0
steps which accepts a strings which is of even b) δ (F, a) =q1
length and has a prefix=’01’ c) δ (F, a) =D
δ (q0, ε) =q0 < δ(q0,0) =δ (δ (q0, ε),0) =δ(q0,0) d) δ (q1, a) =D
Answer: b 10.Which of the following are the final states in the
Explanation: For the given Language, the transition given DFA according to the Language given.?
missing is δ (F, a) =q1. L= {xϵ∑= {a, b} |length of x is at most 2}
7.The complement of a language will only be
defined when and only when the __________ over
the language is defined.
a) String
b) Word
c) Alphabet
d) Grammar
Answer: c
Explanation: It is not possible to define the
complement of a language without defining the
input alphabets. Example: A language which does a) q0, q1
not consist of substring ‘ab’ while the complement b) q0, q2
would be the language which does contain a c) q1, q2
substring ‘ab’. d) q0, q1, q2
8.Which among the following is not notated as Answer: d
infinite language? Explanation: According to the given language, the
a) Palindrome length is at most 2, thus the answer is found
b) Reverse accordingly.
c) Factorial
d) L={ab}* .
Answer: Factorial
Explanation: Factorial, here is the most appropriate The Language of DFA -
non-infinite domain. Otherwise, palindrome and “The Language of DFA”
reverse have infinite domains. 1. How many languages are over the alphabet R?
9.Which among the following states would be a) countably infinite
notated as the final state/acceptance state? b) countably finite
L= {xϵ∑= {a, b} | length of x is 2} c) uncountable finite
d) uncountable infinite
Answer: d
Explanation: A language over an alphabet R is a set
of strings over A which is uncountable and infinite.
2. According to the 5-tuple representation i.e. FA=
{Q, ∑, δ, q, F}
Statement 1: q ϵ Q’; Statement 2: FϵQ
a) Statement 1 is true, Statement 2 is false
b) Statement 1 is false, Statement 2 is true
c) Statement 1 is false, Statement 2 may be true
d) Statement 1 may be true, Statement 2 is false
a) q1
b) q2 Answer: b
c) q1, q2 Explanation: Q is the Finite set of states, whose
d) q3 elements i.e. the states constitute the finite
Answer: b automata.
Explanation: According to the given language, q2 3. δˆ tells us the best:
Is to become the final/acceptance state in order to a) how the DFA S behaves on a word u
satisfy. b) the state is the dumping state
c) the final state has been reached
d) Kleene operation is performed on the set Answer: d
Explanation: The given DFA accepts all the binary
Answer: a strings such that they are divisible by 3 and 2.Thus,
Explanation: δ or the Transition function describes it can be said that it also accepts all the strings
the best, how a DFA behaves on a string where to which is divisible by 6.
transit next, which direction to take. 7. Given:
4. Which of the following option is correct? L1= {xϵ ∑*|x contains even no’s of 0’s}
A= {{abc, aaba}. {ε, a, bb}} L2= {xϵ ∑*|x contains odd no’s of 1’s}
a) abcbb ₵ A No of final states in Language L1 U L2?
b) ε₵A a) 1
c) ε may not belong to A b) 2
d) abca ₵ A c) 3
d) 4
Answer: b
Explanation: As the question has dot operation, ε Answer: c
will not be a part of the concatenated set. Had it Explanation:
been a union operation, ε would be a part of the
operated set.
5. For a DFA accepting binary numbers whose
decimal equivalent is divisible by 4, what are all
the possible remainders?
a) 0
b) 0,2
c) 0,2,4
d) 0,1,2,3
Answer: d
Explanation: All the decimal numbers on division
would lead to only 4 remainders i.e. 0,1,2,3
(Property of Decimal division).
6. Which of the following x is accepted by the 8. The maximum number of transition which can be
given DFA (x is a binary string ∑= {0,1})? performed over a state in a DFA?
∑= {a, b, c}
a) 1
b) 2
c) 3
d) 4
Answer: c
Explanation: The maximum number of transitions
which a DFA allows for a language is the number
of elements the transitions constitute.
9. The maximum sum of in degree and out degree
over a state in a DFA can be determined as:
a) divisible by 3 ∑= {a, b, c, d}
b) divisible by 2 a) 4+4
c) divisible by 2 and 3 b) 4+16
d) divisible by 3 and 2 c) 4+0
d) depends on the Language
Answer: d 4. Extended transition function is .
Explanation: The out degree for a DFA I fixed a) Q * Σ* -> Q
while the in degree depends on the number of states b) Q * Σ -> Q
in the DFA and that cannot be determined without c) Q* * Σ* -> Σ
the dependence over the Language. d) Q * Σ -> Σ
10. The sum of minimum and maximum number of
final states for a DFA n states is equal to: Answer:a
a) n+1 Explanation: This takes single state and string of
b) n input to produce a state.
c) n-1 5. δ*(q,ya) is equivalent to .
d) n+2 a) δ((q,y),a)
b) δ(δ*(q,y),a)
Answer: a c) δ(q,ya)
Explanation: The maximum number of final states d) independent from δ notation
for a DFA can be total number of states itself and
minimum would always be 1, as no DFA exits Answer:b
without a final state. Therefore, the solution is n+1. Explanation: First it parse y string after that it parse
a.
. 6. String X is accepted by finite automata if .
a) δ*(q,x) E A
Finite Automata - b) δ(q,x) E A
“Regular Language & Expression”. c) δ*(Q0,x) E A
1. There are ________ tuples in finite state d) δ(Q0,x) E A
machine.
a) 4 Answer:c
b) 5 Explanation: If automata starts with starting state
c) 6 and after finite moves if reaches to final step then it
d) unlimited called accepted.
7. Languages of a automata is
Answer:b a) If it is accepted by automata
Explanation: states,input symbols,initial b) If it halts
state,accepting state and transition function. c) If automata touch final state in its life time
2. Transition function maps. d) All language are language of automata
a) Σ * Q -> Σ
b) Q * Q -> Σ Answer:a
c) Σ * Σ -> Q Explanation: If a string accepted by automata it is
d) Q * Σ -> Q called language of automata.
8. Language of finite automata is.
Answer:d a) Type 0
Explanation: Inputs are state and input string output b) Type 1
is states. c) Type 2
3. Number of states require to accept string ends d) Type 3
with 10.
a) 3 Answer:d
b) 2 Explanation: According to Chomsky classification.
c) 1 9. Finite automata requires minimum _______
d) can’t be represented. number of stacks.
a) 1
Answer:a b) 0
Explanation: This is minimal finite automata. c) 2
d) None of the mentioned d) None of the mentioned
Answer:b Answer:b
Explanation: Finite automata doesn’t require any Explanation: 2^(m*n) states requires .
stack operation . 15. FSM with output capability can be used to add
10. Number of final state require to accept Φ in two given integer in binary representation. This is
minimal finite automata. a) True
a) 1 b) False
b) 2 c) May be true
c) 3 d) None of the mentioned
d) None of the mentioned
Answer:a
Answer:d Explanation: Use them as a flip flop output .
Explanation: No final state requires.
11. Regular expression for all strings starts with ab .
and ends with bba is.
a) aba*b*bba Non Deterministic Finite Automata-Introduction
b) ab(ab)*bba -
c) ab(a+b)*bba “Non Deterministic Finite Automata-Introduction”
d) All of the mentioned 1. Which of the following options is correct?
Statement 1: Initial State of NFA is Initial State of
Answer:c DFA.
Explanation: Starts with ab then any number of a or Statement 2: The final state of DFA will be every
b and ends with bba. combination of final state of NFA.
12. How many DFA’s exits with two states over a) Statement 1 is true and Statement 2 is true
input alphabet {0,1} ? b) Statement 1 is true and Statement 2 is false
a) 16 c) Statement 1 can be true and Statement 2 is true
b) 26 d) Statement 1 is false and Statement 2 is also false
c) 32
d) 64 Answer: a
Explanation: Statement 1 and 2 always true for a
Answer:d given Language.
Explanation: Number of DFA’s = 2^n * n^(2*n). 2. Given Language: L= {ab U aba}*
13. The basic limitation of finite automata is that If X is the minimum number of states for a DFA
a) It can’t remember arbitrary large amount of and Y is the number of states to construct the NFA,
information. |X-Y|=?
b) It sometimes recognize grammar that are not a) 2
regular. b) 3
c) It sometimes fails to recognize regular grammar. c) 4
d) All of the mentioned d) 1
Answer:a Answer: a
Explanation:Because there is no memory associated Explanation: Construct the DFA and NFA
with automata. individually, and the attain the difference of states.
14. Number of states require to simulate a computer 3. An automaton that presents output based on
with memory capable of storing ‘3’ words each of previous state or current input:
length ‘8’. a) Acceptor
a) 3 * 2^8 b) Classifier
b) 2^(3*8) c) Transducer
c) 2^(3+8)
d) None of the mentioned. d) Cannot be determined.
Answer: c Answer: a
Explanation: A transducer is an automaton that Explanation: The individual Transition graphs can
produces an output on the basis of what input has be made and the difference of transitions can be
been given currently or previous state. determined.
4. If NFA of 6 states excluding the initial state is 8. The construction time for DFA from an
converted into DFA, maximum possible number of equivalent NFA (m number of node)is:
states for the DFA is ? a) O(m2)
a) 64 b) O(2m)
b) 32 c) O(m)
c) 128 d) O(log m)
d) 127
Answer: b
Answer: c Explanation: From the coded NFA-DFA
Explanation: The maximum number of sets for conversion.
DFA converted from NFA would be not greater 9. If n is the length of Input string and m is the
than 2n. number of nodes, the running time of DFA is x that
5. NFA, in its name has ’non-deterministic’ of NFA.Find x?
because of : a) 1/m2
a) The result is undetermined b) 2m
b) The choice of path is non-deterministic c) 1/m
c) The state to be transited next is non-deterministic d) log m
d) All of the mentioned
Answer: a
Answer: b Explanation: Running time of DFA: O(n) and
Explanation: Non deterministic or deterministic Running time of NFA =O(m2n).
depends upon the definite path defined for the 10. Which of the following option is correct?
transition from one state to another or a) NFA is slower to process and its representation
undefined(multiple paths). uses more memory than DFA
6. Which of the following is correct proposition? b) DFA is faster to process and its representation
Statement 1: Non determinism is a generalization uses less memory than NFA
of Determinism. c) NFA is slower to process and its representation
Statement 2: Every DFA is automatically an NFA uses less memory than DFA
a) Statement 1 is correct because Statement 2 is d) DFA is slower to process and its representation
correct uses less memory than NFA
b) Statement 2 is correct because Statement 2 is
correct Answer: c
c) Statement 2 is false and Statement 1 is false Explanation: NFA, while computing strings, take
d) Statement 1 is false because Statement 2 is false parallel paths, make different copies of input and
goes along different paths in order to search for the
Answer: b result. This creates the difference in processing
Explanation: DFA is a specific case of NFA. speed of DFA and NFA.
7. Given Language L= {xϵ {a, b}*|x contains aba
as its substring} .
Find the difference of transitions made in
constructing a DFA and an equivalent NFA? Extended Transition Function -
a) 2 “Extended Transition Function”.
b) 3 1. The number of tuples in an extended Non
c) 4 Deterministic Finite Automaton:
a) 5 a) DFA > NFA
b) 6 b) NFA > DFA
c) 7 c) Equal
d) 4 d) Can’t be said
Answer: a Answer: c
Explanation: For NFA or extended transition Explanation: DFA is said to be a specific case of
function on NFA, the tuple elements remains same NFA and for every NFA that exists for a given
i.e. 5. language, an equivalent DFA also exists.
2. Choose the correct option for the given 6. If a string S is accepted by a finite state
statement: automaton, S=s1s2s3……sn where siϵ∑ and there
Statement: The DFA shown represents all strings exists a sequence of states r0, r1, r2…… rn such
which has 1 at second last position. that δ(r(i), si+1) =ri+1 for each 0, 1, …n-1, then r(n)
is:
a) initial state
b) transition symbol
c) accepting state
a) Correct d) intermediate state
b) Incorrect, Incomplete DFA
c) Wrong proposition Answer: c
d) May be correct Explanation: r(n) is the final state and accepts the
string S after the string being traversed through r(i)
Answer: c other states where I ϵ 01,2…(n-2).
Explanation: The given figure is an NFA. The 7. According to the given table, compute the
statement contradicts itself. number of transitions with 1 as its symbol but not
3. What is wrong in the given definition? 0:
Def: ({q0, q1, q2}, {0,1}, δ, q3, {q3})
a) The definition does not satisfy 5 Tuple definition
of NFA.
b) There are no transition definition.
c) Initial and Final states do not belong to the
Graph. a) 4
d) Initial and final states can’t be same. b) 3
c) 2
Answer: c d) 1
Explanation: q3 does not belong to Q where Q= set
of finite states. Answer: d
4. If δ is the transition function for a given NFA, Explanation: The transition graph is made and thus
then we define the δ’ for the DFA accepting the the answer can be found.
same language would be: 8. From the given table, δ*(q0, 011) =?
Note: S is a subset of Q and a is a symbol.
a) δ’ (S, a) =Upϵs δ (p, a)
b) δ’ (S, a) =Up≠s δ (p, a)
c) δ’ (S, a) =Upϵs δ(p)
d) δ’ (S) =Up≠s δ(p)
a) {q0}
Answer: a b) {q1} U {q0, q1, q2}
Explanation: According to subset construction, c) {q2, q1}
equation 1 holds true. d) {q3, q1, q2, q0}
5. What is the relation between DFA and NFA on
the basis of computational power?
Answer: b c) Eliminating Null references
Explanation: δ*(q0,011) = Urϵδ*(q0,01) δ (r, 1) = d) ε-NFA to NFA
{q0, q1, q2}.
9. Number of times the state q3 or q2 is being a part Answer: a
of extended 6 transition state is Explanation: The conversion of a non-deterministic
automata into a deterministic one is a process we
call subset construction or power set construction.
2. Given Language:
Ln= {xϵ {0,1} * | |x|≥n, nth symbol from the right in
x is 1}
How many state are required to execute L3 using
NFA?
a) 16
b) 15
c) 8
d) 7
Answer: b
a) 6 Explanation: The finite automaton for the given
b) 5 language is made and thus, the answer can be
c) 4 obtained.
d) 7 3. Which of the following does the given NFA
represent?
Answer: a
Explanation: According to the question, presence of
q2 or q1 would count so it does and the answer
according to the diagram is 6.
10. Predict the missing procedure:
1.Δ(Q0, ε) ={Q0},
2.Δ(Q0, 01) = {Q0, Q1}
3.δ(Q0, 010) =?
a) {Q0, Q1, Q2}
b) {Q0, Q1}
c) {Q0, Q2}
d) {Q1, Q2}
a) {11, 101} * {01}
Answer: c b) {110, 01} * {11}
Explanation: According to given table and c) {11, 110} * {0}
extended transition state implementation, we can d) {00, 110} * {1}
find the state at which it rests.
Answer: c
. Explanation: The given diagram can be analysed
and thus the option can be seeked.
The Language of NFA - 4. The number of transitions required to convert the
“The Language of NFA”. following into equivalents DFA:
1. Subset Construction method refers to:
a) Conversion of NFA to DFA
b) DFA minimization
a) 2 Answer: b
b) 3 Explanation: The production of form non-terminal -
c) 1 >ε is call null production.
d) 0 9. Which of the following is a regular language?
a) String whose length is a sequence of prime
Answer: a numbers
Explanation: b) String with substring wwr in between
c) Palindrome string
d) String with even number of Zero’s
Answer: d
Explanation: DFSM’s for the first three option is
5. If L is a regular language, Lc and Lr both will be: not possible; hence they aren’t regular.
a) Accepted by NFA 10. Which of the following recognizes the same
b) Rejected by NFA formal language as of DFA and NFA?
c) One of them will be accepted a) Power set Construction
d) Cannot be said. b) Subset Construction
c) Robin-Scott Construction
Answer: a d) All of the mentioned.
Explanation: If L is a regular Language, Lc and Lr
both are regular even. Answer: d
6. In NFA, this very state is like dead-end non final Explanation: All the three option refers to same
state: technique if distinguishing similar constructions for
a) ACCEPT different type of automata.
b) REJECT
c) DISTINCT .
d) START
Equivalence of NFA and DFA -
Answer: b “Equivalence of NFA and DFA”.
Explanation: REJECT state will be like a halting 1. Under which of the following operation, NFA is
state which rejects a particular invalid input. not closed?
7. We can represent one language in more one a) Negation
FSMs, true or false? b) Kleene
a) TRUE c) Concatenation
b) FALSE d) None of the mentioned
c) May be true
d) Cannot be said Answer: d
Explanation: NFA is said to be closed under the
Answer: a following operations:
Explanation: We can represent one language in a) Union
more one FSMs, example for a same language we b) Intersection
have a DFA and an equivalent NFA. c) Concatenation
8. The production of form non-terminal -> ε is d) Kleene
called: e) Negation
a) Sigma Production 2. It is less complex to prove the closure properties
b) Null Production over regular languages using
c) Epsilon Production a) NFA
d) All of the mentioned b) DFA
c) PDA
d) Can’t be said a) Communication Link
b) Adder
Answer: a c) Stack
Explanation: We use the construction method to d) None of the mentioned
prove the validity of closure properties of regular
languages. Thus, it can be observe, how tedious and Answer: a
complex is the construction of a DFA as compared Explanation: Idle is the state when data in form of
to an NFA with respect to space. packets is send and returns if NAK is received else
3. Which of the following is an application of waits for the NAK to be received.
Finite Automaton? 7. Which among the following is not an application
a) Compiler Design of FSM?
b) Grammar Parsers a) Lexical Analyser
c) Text Search b) BOT
d) All of the mentioned c) State charts
d) None of the mentioned
Answer: d
Explanation: There are many applications of finite Answer: d
automata, mainly in the field of Compiler Design Explanation: Finite state automation is used in
and Parsers and Search Engines. Lexical Analyser, Computer BOT (used in games),
4. John is asked to make an automaton which State charts, etc.
accepts a given string for all the occurrence of 8. L1= {w | w does not contain the string tr }
‘1001’ in it. How many number of transitions L2= {w | w does contain the string tr}
would John use such that, the string processing Given ∑= {t, r}, The difference of the minimum
application works? number of states required to form L1 and L2?
a) 9 a) 0
b) 11 b) 1
c) 12 c) 2
d) 15 d) Cannot be said
Answer: a Answer: a
Explanation: Explanation:
Answer: c
Explanation: Thompson Construction method is
used to turn a regular expression in an NFA by
fragmenting the given regular expression through
the operations performed on the input alphabets.
6. Which among the following can be an example
of application of finite state machine(FSM)?
9. Predict the number of transitions required to
automate the following language using only 3
states:
L= {w | w ends with 00}
a) 3
b) 2
2. A binary string is divisible by 4 if and only if it
c) 4
ends with:
d) Cannot be said
a) 100
b) 1000
Answer: a
c) 1100
Explanation:
d) 0011
Answer: a
Explanation: If the string is divisible by four, it
surely ends with the substring ‘100’ while a binary
string divisible by 2 would surely end with the
substring ‘10’.
3. Let L be a language whose FA consist of 5
10. The total number of states to build the given acceptance states and 11 non final states. It further
language using DFA: consists of a dumping state. Predict the number of
L= {w | w has exactly 2 a’s and at least 2 b’s} acceptance states in Lc.
a) 10 a) 16
b) 11 b) 11
c) 12 c) 5
d) 13 d) 6
Answer: a Answer: a
Explanation: Explanation: If L leads to FA1, then for Lc, the FA
We need to make the number of a as fixed i.e. 2 can be obtained by exchanging the final and non-
and b can be 2 or more. Thus, using this condition a final states.
finite automata can be created using 1 states. 4. If L1 and L2 are regular languages, which among
the following is an exception?
. a) L1 U L2
b) L1 – L2
Applications of DFA - c) L1 ∩ L2
“Applications of DFA”. d) All of the mentioned
1. Given Language: {x | it is divisible by 3}
The total number of final states to be assumed in Answer: d
order to pass the number constituting {0, 1} is Explanation: It the closure property of Regular
a) 0 language which lays down the following statement:
b) 1 If L1, L2 are 2- regular languages, then L1 U L2,
c) 2 L1 ∩ L2, L1C, L1 – L2 are regular language.
d) 3 5. Predict the analogous operation for the given
language:
Answer: c A: {[p, q] | p ϵ A1, q does not belong to A2}
Explanation: The DFA for the given language can a) A1-A2
be constructed as follows: b) A2-A1
c) A1.A2
d) A1+A2
Answer: a string, if it has the choice to split, it goes in all
Explanation: When set operation ‘-‘ is performed possible way and each one is different copy of the
between two sets, it points to those values of prior machine. The machine takes subsequent choice to
set which belongs to it but not to the latter set split further giving rise to more copies of the
analogous to basic subtraction operation. machine getting each copy run parallel. If any one
6. Which among the following NFA’s is correct copy of the machine accepts the strings, then NFA
corresponding to the given Language? accepts, otherwise it rejects.
L= {xϵ {0, 1} | 3rd bit from right is 0} 8. Which of the following options is correct for the
a) given statement?
Statement: If K is the number of states in NFA, the
DFA simulating the same language would have
states less than 2k.
a) True
b) False
Answer: a
b)
Explanation: If K is the number of states in NFA,
the DFA simulating the same language would have
states equal to or less than 2k.
9. Let N (Q, ∑, δ, q0, A) be the NFA recognizing a
language L. Then for a DFA (Q’, ∑, δ’, q0’, A’),
which among the following is true?
a) Q’ = P(Q)
c) b) Δ’ = δ’ (R, a) = {q ϵ Q | q ϵ δ (r, a), for some r ϵ
R}
c) Q’={q0}
d) All of the mentioned
Answer: d
Explanation: All the optioned mentioned are the
instruction formats of how to convert a NFA to a
d) None of the mentioned
DFA.
10. There exists an initial state, 17 transition states,
Answer: a
7 final states and one dumping state, Predict the
Explanation: The NFA accepts all binary strings
maximum number of states in its equivalent DFA?
such that the third bit from right end is 1 and if not,
a) 226
is send to Dumping state. Note: It is assumed that
b) 224
the input is given from the right end bit by bit.
c) 225
7. Statement 1: NFA computes the string along
d) 223
parallel paths.
Statement 2: An input can be accepted at more than
Answer: a
one place in an NFA.
Explanation: The maximum number of states an
Which among the following options are most
equivalent DFA can comprise for its respective
appropriate?
NFA with k states will be 2k.
a) Statement 1 is true while 2 is not
b) Statement 1 is false while is not
.
c) Statement 1 and 2, both are true
d) Statement 1 and 2, both are false
Automata Theory Test -
This set of Automata Theory test focuses on “Finite
Answer: c
Explanation: While the machine runs on some input Automata with Epsilon Transition”.
1. According to the given transitions, which among method can be called one to introduce hidden non-
the following are the epsilon closures of q1 for the determinism.
given NFA? 5. ε- closure of q1 in the given transition graph:
Δ (q1, ε) = {q2, q3, q4} a) {q1}
Δ (q4, 1) =q1 b) {q0, q2}
Δ (q1, ε) =q1 c) {q1, q2}
a) q4 d) {q0, q1, q2}
b) q2
c) q1 Answer: c
d) q1, q2, q3, q4 Explanation: ε-closure is defined as the set of states
being reached through ε-transitions from a starting
Answer: d state.
Explanation: The set of states which can be reached 6. Predict the total number of final states after
from q using ε-transitions, is called the ε-closure removing the ε-moves from the given NFA?
over state q. a) 1
2. State true or false? b) 2
Statement: An NFA can be modified to allow c) 3
transition without input alphabets, along with one d) 0
or more transitions on input symbols.
a) True Answer: c
b) False Explanation: The NFA which would result after
eliminating ε-moves can be shown diagramatically.
Answer: a 7. For NFA with ε-moves, which among the
Explanation: It is possible to construct an NFA following is correct?
with ε-transitions, presence of no input symbols, a) Δ: Q X (∑ U {ε}) -> P(Q)
and that is called NFA with ε-moves. b) Δ: Q X (∑) -> P(Q)
3. State true or false? c) Δ: Q X (∑*) -> P(Q)
Statement: ε (Input) does not appears on Input tape. d) All of the mentioned
a) True
b) False Answer: a
Answer: a Explanation: Due to the presence of ε symbol, or
rather an epsilon-move, the input alphabets unites
Explanation: ε does not appears on Input tape, ε with it to form a set including ε.
transition means a transition without scanning a 8. Which among the following is false?
symbol i.e. without moving the read head. ε-closure of a subset S of Q is:
4. Statement 1: ε- transition can be called as hidden a) Every element of S ϵ Q
non-determinism. b) For any q ϵ ε(S), every element of δ (q, ε) is in
Statement 2: δ (q, ε) = p means from q it can jump ε(S)
to p with a shift in read head. c) No other element is in ε(S)
Which among the following options is correct? d) None of the mentioned
a) Statement 1 and 2, both are correct
b) Statement 1 and 2, both are wrong Answer: d
c) Statement 1 is correct while Statement 2 is Explanation: All the mentioned are the closure
wrong properties of ε and encircles all the elements if it
d) Statement 1 is wrong while Statement 2 is satisfies the following options:
correct a) Every element of S ϵ Q
b) For any q ϵ ε(S), every element of δ (q, ε) is in
Answer: c ε(S)
Explanation: The transition with ε leads to a jump c) No other element is in ε(S)
but without any shift in read head. Further, the
9. The automaton which allows transformation to a e) Star
new state without consuming any input symbols: f) Kleene closure
a) NFA
b) DFA To practice all areas of Automata Theory for tests, .
c) NFA-l Automata Theory Questions and – Uses of
d) All of the mentioned Epsilon-Transitions
“Uses of Epsilon-Transitions”.
Answer: c 1. The automaton which allows transformation to a
Explanation: NFA-l or e-NFA is an extension of new state without consuming any input symbols:
Non deterministic Finite Automata which are a) NFA
usually called NFA with epsilon moves or lambda b) DFA
transitions. c) NFA-l
10. e-transitions are d) All of the mentioned
a) conditional
b) unconditional Answer: c
c) input dependent Explanation: NFA-l or e-NFA is an extension of
d) none of the mentioned Non deterministic Finite Automata which are
usually called NFA with epsilon moves or lambda
Answer: b transitions.
Explanation: An epsilon move is a transition from 2. e-transitions are
one state to another that doesnt require any specific a) conditional
condition. b) unconditional
11. The __________ of a set of states, P, of an c) input dependent
NFA is defined as the set of states reachable from d) none of the mentioned
any state in P following e-transitions.
a) e-closure Answer: b
b) e-pack Explanation: An epsilon move is a transition from
c) Q in the tuple one state to another that doesn’t require any
d) None of the mentioned specific condition.
3. The __________ of a set of states, P, of an NFA
Answer: a is defined as the set of states reachable from any
Explanation: The e-closure of a set of states, P, of state in P following e-transitions.
an NFA is defined as the set of states reachable a) e-closure
from any state in P following e-transitions. b) e-pack
12. The e-NFA recognizable languages are not c) Q in the tuple
closed under : d) None of the mentioned
a) Union
b) Negation Answer: a
c) Kleene Closure Explanation: The e-closure of a set of states, P, of
d) None of the mentioned an NFAis defined as the set of states reachable
from any state in P following e-transitions.
Answer: d 4. The e-NFA recognizable languages are not
Explanation: The languages which are recognized closed under :
by an epsilon Non deterministic automata are a) Union
closed under the following operations: b) Negation
a) Union c) Kleene Closure
b) Intersection d) None of the mentioned
c) Concatenation
d) Negation Answer: The languages which are recognized by an
epsilon Non deterministic automata are closed
under the following operations:
a) Union
b) Intersection
c) Concatenation
d) Negation
e) Star
f) Kleene closure
Epsilon Closures -
“Epsilon Closures”.
1. Which of the following does not belong to input
alphabet if S={a, b}* for any language?
a) a
b) b
c) e
d) None of the mentioned
Answer: c
Explanation: The automaton may be allowed to 3. An e-NFA is ___________ in representation.
change its state without reading the input symbol a) Quadruple
using epsilon but this does not mean that epsilon b) Quintuple
has become an input symbol. On the contrary, one c) Triple
assumes that the symbol epsilon does not belong to d) None of the mentioned
any alphabet.
2. The number of final states we need as per the Answer: b
given language? Explanation: An e-NFA consist of 5 tuples: A=(Q,
Language L: {an| n is even or divisible by 3} S, d, q0, F)
a) 1 Note: e is never a member of S.
b) 2 4. State true or false:
c) 3 Statement: Both NFA and e-NFA recognize exactly
d) 4 the same languages.
a) true
Answer: b b) false
Explanation:
Answer: a
Explanation: e-NFA do come up with a convenient
feature but nothing new.They do not extend the
class of languages that can be represented.
5. Design a NFA for the language:
L: {an| n is even or divisible by 3}
Which of the following methods can be used to
simulate the same.
a) e-NFA
b) Power Construction Method
c) Both (a) and (b)
d) None of the mentioned
Answer: c
Explanation: It is more convenient to simulate a
machine using e-NFA else the method of Power
Construction is used from the union-closure of 8. Which of the steps are non useful while
DFA’s. eliminating the e-transitions for the given diagram?
6. Which of the following belongs to the epsilon
closure set of a?
Answer: a
Explanation: Yes, the language is preserved during
the dteps of construction:
L(N)=L(N1)=L(N2)=L(3).
10. Remove all the epsilon transitions in the given
diagram and compute the number of a-transitions in
the result?
a) 0
b) 1
c) 2
d) 3
Answer: c
Explanation: The epsilon closure set of f2 consist
of the elements:{f2, f3}. Thus the count of the
element in the closure set is 2.
Answer:a
Explanation: Regular sets are closed under these
three operation.
2. Complement of a DFA can be obtained by
a) making starting state as final state.
b) no trival method.
c) making final states non-final and non-final to
final.
d) make final as a starting state.
Answer:c
Explanation: String accepted in previous DFA will
not be accepted and non accepting string will be
accepted .
a) 5 3. Complement of regular sets are _________ .
b) 7 a) Regular
c) 9 b) CFG
d) 6 c) CSG
d) RE
Answer: b
Explanation: Answer:a
Explanation: Regular sets are closed under
complement operation.
4. If L1 and L2 are regular sets then intersection of
these two will be
a) Regular
b) Non Regular
c) Recursive
d) Non Recursive
Answer:a
Explanation: Regular expression are also colsed
under intersection.
5. If L1 is regular L2 is unknown but L1-L2 is
regular ,then L2 must be
a) Empty set
b) CFG
c) Decidable
. d) Regular
Answer: d
Explanation: The extended notation would be
a) (0+1) *(00+11) (0+1) *
(0+1)4 but however, we may allow some or all the
b) (0+1) *(00+11) *(0+1) *
factors to be ε. Thus ε needs to be included in the
c) (0+1) *(00+11) (0+1)
given regular expression.
d) (0+1) (00+11) (0+1) *
5. Which among the following looks similar to the
given expression?
Answer: a
((0+1). (0+1)) *
Explanation: The transition states shown are the
a) {xϵ {0,1} *|x is all binary number with even
result of breaking down the given regular
length}
expression in fragments. For dot operation, we
b) {xϵ {0,1} |x is all binary number with even
change a state, for union (plus) operation, we
length}
diverge into two transitions and for Kleene
c) {xϵ {0,1} *|x is all binary number with odd
Operation, we apply a loop.
length}
8. Concatenation Operation refers to which of the
d) {xϵ {0,1} |x is all binary number with odd
following set operations:
length}
a) Union
b) Dot
Answer: a
c) Kleene
Explanation: The given regular expression
d) Two of the options are correct
corresponds to a language of binary strings which
is of even length including a length of 0.
Answer: b
6. If R represents a regular language, which of the
Explanation: Two operands are said to be
following represents the Venn-diagram most
{xy: x ∈ A & y ∈ B}.
performing Concatenation operation AB = A•B = c) (1+(011) *) *
d) (1011) *
9. Concatenation of R with Ф outputs:
a) R Answer: a
b) Ф Explanation: ε+1*(011) *(1*(011) *) *
c) R.Ф ε + RR*= ε + R*R= ε + R+= R*
d) None of the mentioned 4. P, O, R be regular expression over ∑, P is not ε,
then
Answer: b R=Q + RP has a unique solution:
Explanation: By distributive property (Regular a) Q*P
expression identities), we can prove the given b) QP*
identity to be Ф. c) Q*P*
10. RR* can be expressed in which of the forms: d) (P*O*) *
a) R+
b) R- Answer: b
c) R+ U R- Explanation: The given statement is the Arden’s
d) R Theorem and it tends to have a unique solution as
QP*.
Answer: a Let P and Q be regular expressions,
Explanation: RR*=R+ as R+ means the occurrence R=Q+RP
to be at least once. R=Q+(Q+RP) P
R=Q+((Q+RP) +RP)
. +P=Q+QP+RPP+RPP=Q+QP+(Q+RP) PP+
(Q+RP) PP=Q+QP+QPP+RPPP+QPP+RPPP,
Operators of Regular Expression - If we do this recursively, we get:
“Operators of Regular Expression”. R= QP*
1. A finite automaton accepts which type of 5. Arden’s theorem is true for:
language: a) More than one initial states
a) Type 0 b) Null transitions
b) Type 1 c) Non-null transitions
c) Type 2 d) None of the mentioned
d) Type 3
Answer: c
Answer: d Explanation: Arden’s theorem strictly assumes the
Explanation: Type 3 refers to Regular Languages following;
which is accepted by a finite automaton. a) No null transitions in the transition diagrams
2. Which among the following are incorrect regular b) True for only single initial state
identities? 6. The difference between number of states with
a) εR=R regular expression (a + b) and (a + b) * is:
b) ε*=ε a) 1
c) Ф*=ε b) 2
d) RФ=R c) 3
d) 0
Answer: d
Explanation: There are few identities over Regular Answer: a
Expressions which include: RФ=ФR=Ф≠R Explanation:
3. Simplify the following regular expression: 7. In order to represent a regular expression, the
ε+1*(011) *(1*(011) *) * first step to create the transition diagram is:
a) (1+011) * a) Create the NFA using Null moves
b) (1*(011) *) b) Null moves are not acceptable, thus should not
be used This set of Automata Theory Quiz focuses on
c) Predict the number of states to be used in order “Building Regular Expressions”.
to construct the Regular expression 1. Which of the following is correct?
d) None of the mentioned Statement 1: ε represents a single string in the set.
Statement 2: Ф represents the language that consist
Answer: a of no string.
Explanation: Two steps are to be followed while a) Statement 1 and 2 both are correct
converting a regular expression into a transition b) Statement 1 is false but 2 is correct
diagram: c) Statement 1 and 2 both are false
a) Construct the NFA using null moves. d) There is no difference between both the
b) Remove the null transitions and convert it into statements, ε and Ф are different notation for same
its equivalent DFA. reason
8. (0+ε) (1+ε) represents
a) {0, 1, 01, ε} Answer: a
b) {0, 1, ε} Explanation: ε represents a single string in the set
c) {0, 1, 01 ,11, 00, 10, ε} namely, the empty string while Statement 2 is also
d) {0, 1} correct.
2. The appropriate precedence order of operations
Answer: a over a Regular Language is
Explanation: The regular expression is fragmented a) Kleene, Union, Concatenate
and the set of the strings eligible is formed. ‘+’ b) Kleene, Star, Union
represents union while ‘.’ Represents c) Kleene, Dot, Union
concatenation. d) Star, Union, Dot
9. The minimum number of states required to
automate the following Regular Expression: Answer: c
(1) *(01+10) (1) * Explanation: If a regular language expression is
a) 4 given, the appropriate order of precedence if the
b) 3 parenthesis is ignored is: Star or Kleene, Dot or
c) 2 Concatenation, Union or Plus.
d) 5 3. Regular Expression R and the language it
describes can be represented as:
Answer: a a) R, R(L)
10. Regular Expression denote precisely the b) L(R), R(L)
________ of Regular Language. c) R, L(R)
a) Class d) All of the mentioned
b) Power Set
c) Super Set Answer: c
d) None of the mentioned Explanation: When we wish to distinguish between
a regular expression R and the language it
Answer: a represents; we write L(R) to be the language of R.
Explanation: Regular Expression denote precisely 4. Let for ∑= {0,1} R= (∑∑∑) *, the language of R
the class of regular language. Given any regular would be
expression, L(R) is a regular language. Given any a) {w | w is a string of odd length}
regular language L, there is a regular expression R, b) {w | w is a string of length multiple of 3}
such that L(R)=L. c) {w | w is a string of length 3}
d) All of the mentioned
.
Answer: b
Automata Theory Quiz - Explanation: This regular expression can be used to
eliminate the and get the result. The length can be
even and as well more than 3 when R= (∑∑∑) 9. (a + b*c) most correctly represents:
(∑∑∑) (particular case). a) (a +b) *c
5. If ∑= {0,1}, then Ф* will result to: b) (a)+((b)*.c)
a) ε c) (a + (b*)).c
b) Ф d) a+ ((b*).c)
c) ∑
d) None of the mentioned Answer: d
Explanation: Following the rules of precedence,
Answer: a Kleene or star operation would be done first, then
Explanation: The star operation brings together any concatenation and finally union or plus operation.
number of strings from the language to get a string 10. Which of the following regular expressions
in the result. If the language is empty, the star represents the set of strings which do not contain a
operation can put together 0 strings, resulting only substring ‘rt’ if ∑= {r, t}
the empty string. a) (rt)*
6. The given NFA represents which of the b) (tr)*
following NFA c) (r*t*)
a) (ab U a) * d) (t*r*)
b) (a*b* U a*)
c) (ab U a*) Answer: d
d) (ab)* U a* Explanation: As Kleene operation is not on the
whole of the substring, it will not repeat and
Answer: a maintain the order of t, r.
Explanation: The Regular expression (ab U a) * is 11. According to the precedence rules, x-y-z is
converted to NFA in a sequence of stages as it can equivalent to which of the following?
be clearly seen in the diagram. This NFA consist of a) (x-y)-z
8 stated while its minimized form only contains 2 b) x-(y-z)
states. c) Both (a) and (b)
7. Which of the following represents a language d) None of the mentioned
which has no pair of consecutive 1’s if ∑= {0,1}?
a) (0+10)*(1+ε) Answer: a
b) (0+10)*(1+ε)* Explanation: In arithmetic, we group two of the
c) (0+101)*(0+ε) same operators from the left, hence x-y-z is
d) (1+010)*(1+ε) equivalent to (x-y)-z and not x-(y—z).
12. Dot operator in regular expression resembles
Answer: a which of the following?
Explanation: All the options except ‘a’ accept those a) Expressions are juxtaposed
strings which comprises minimum one pair of 1’s b) Expressions are multiplied
together. c) Cross operation
8. The finite automata accept the following d) None of the mentioned
languages:
a) Context Free Languages Answer: a
b) Context Sensitive Languages Explanation: Dot operation or concatenation
c) Regular Languages operation means that the two expressions are
d) All the mentioned juxtaposed i.e. there are no intervening operators in
between. In fact, UNIX regular expressions use the
Answer: c dot for an entirely different purpose: representing
Explanation: A finite automaton accepts the any ASCII character.
languages which are regular and for which a DFA 13. Which among the following is not an
can be constructed. associative operation?
a) Union
b) Concatenation can be represented using NFA with e moves
c) Dot d) Regular expression is just another representation
d) None of the mentioned for any automata definition
Answer: d Answer: b
Explanation: It does not matter in which order we Explanation: Using NFA with e moves, we can
group the expression with the operators as they are represent all the regular expressions as an
associative. If one gets a chance to group the automata. As regular expressions include e, we
expression, one should group them from left for need to use e moves.
convenience. For instance, 012 is grouped as (01)2. 3. The total number of states required to automate
14.Which among the following is equivalent to the the given regular expression
given regular expression? (00)*(11)*
01*+1 a) 3
a) (01)*+1 b) 4
b) 0((1)*+1) c) 5
c) (0(1)*)+1 d) 6
d) ((0*1)1*)*
Answer: c
Answer: c Explanation:
Explanation: Using the rules of precedence on the
give expression, c is the appropriate choice with the
order of: Bracket>Kleene>Dot>Union
a) (0+1)*001(0+1)*
b) 1*001(0+1)*
c) (01)*(0+0+1)(01)*
d) None of these
Answer: a
Explanation: There needs to be 001 together in the
string as an essential substring. Thus, the other
components can be anything, 0 or 1 or e.
2. Which of the following statements is not true?
a) Every language defined by any of the automata
is also defined by a regular expression a) (110+1)*0
b) Every language defined by a regular expression b) (11+110)*1
can be represented using a DFA c) (110+11)*0
c) Every language defined by a regular expression
d) (1+110)*1
Answer: c
Explanation: There is no state change for union
operation, but has two different paths while for
concatenation or dot operation, we have a state
change for every element of the string.
5. Generate a regular expression for the following
problem statement: 8. Which of the regular expressions corresponds to
Password Validation: String should be 8-15 the given problem statement:
characters long. String must contain a number, an P(x): Express the identifiers in C Programming
Uppercase letter and a Lower case letter. language
a) ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,15}$ l=letters
b) ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{9,16}$ d=digits
c) ^(?=.[a-z])(?=.[A-Z])(?=.\d).{8,15}$ a) (l+_)(d+_)*
d) None of the mentioned b) (l+d+_)*
c) (l+_)(l+d+_)*
Answer: a d) (_+d)(l+d+_)*
Explanation: Passwords like abc123, 123XYZ,
should not be accepted . If one also wants to Answer: c
include special characters as one of the constraint, Explanation:
one can use the following regular expression: Identifiers in C Programming Language follows the
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-za-Z]). following identifiers rule:
{8,15}$ a) The name of the identifier should not begin with
6. Generate a regular expression for the following a digit.
problem statement: b) It can only begin with a letter or a underscore.
P(x): String of length 6 or less for å={0,1}* c) It can be of length 1 or more.
a) (1+0+e)6 9. Generate a regular expression for the given
b) (10)6 language:l
c) (1+0)(1+0)(1+0)(1+0)(1+0)(1+0) L(x): {xÎ{0,1}*| x ends with 1 nd does not contain
d) More than one of the mentioned is correct a substring 01}
a) (0+01)*
Answer: a b) (0+01)*1
Explanation: As the input variables are under c) (0+01)*(1+01)
Kleene Operation, we need to include e,thus option d) All of the mentioned
c is not correct,thereby option (a) is the right
answer. Answer: c
7. The minimum number of states required in a Explanation: (a) and (b) are the general cases where
DFA (along with a dumping state) to check we restrict the acceptance of a string witrh
whether the 3rd bit is 1 or not for |n|>=3 substring 00 but we ignore the case where the string
a) 3 needs to end with 1 which therby, does not allows
b) 4 the acceptance of e.
c) 5 10. The minimum number of transitions to pass to
d) 1 reach the final state as per the following regular
expression is:
Answer: c {a,b}*{baaa}
Explanation: a) 4
b) 5
c) 6
d) 3 non accepting, and hold an e-transitions from each
former accepting state to the new accepting state.
Answer: a 3. Which of the following is not a step in
Explanation: elimination of states procedure?
a) Unifying all the final states into one using e-
transitions
b) Unify single transitions to multi transitions that
contains union of input
c) Remove states until there is only starting and
accepting states
d) Get the resulting regular expression by direct
calculation
Answer: b
Explanation: While eliminating the states, we unify
multiple transitions to one transition that contains
union of input and not the vice versa.
4. Can the given state diagram be reduced?
Answer: a Answer : a
Explanation: For every state which is eliminated, a Explanation : None.
new regular expression is produced. The newly 4. Regular expression Φ* is equivalent to
generated regular expression act as an input for a a) ϵ
state which is next to removed state. b) Φ
c) 0
d) 1 b) i,ii are equal and i,iii are not
c) ii,iii are equal and i,ii are not
Answer : a d) all are equal
Explanation : None.
5. a? is equivalent to Answer : d
a) a Explanation : All are equivalent to (a+b)*.
b) a+Φ
c) a+ϵ .
d) wrong expression
Regular Language & Expression - 2 -
Answer : c “Regular Language & Expression”.
Explanation : Zero or one time repetition of 1. How many strings of length less than 4 contains
previous character . the language described by the regular expression
6. ϵL is equivalent to (x+y)*y(a+ab)*?
a) ϵ a) 7
b) Φ b) 10
c) L c) 12
d) Lϵ d) 11
Answer: a
Explanation: Lowercase letters near the beginning
of an alphabet, a, b and so on are terminal symbols.
We shall also assume that digits and other
characters such as + or parenthesis are terminals.
8. Choose the incorrect process to check whether
the string belongs to the language of certain
variable or not?
a) recursive inference
b) derivations
c) head to body method
d) All of the mentioned .
Answer: d Answer: c
Explanation: There is no regular expression that Explanation: We select a string w such that w=xyz
can parse HTML documents. Other options are also and |y|>0 and other conditions. However, there
non-regular as they cannot be drawn into finite exists an integer n such that |w|>=n for any wÎL.
automaton. 3. If we select a string w such that w∈L, and
10. Finite state machine are not able to recognize w=xyz. Which of the following portions cannot be
Palindromes because: an empty string?
a) Finite automata cannot deterministically find the a) x
midpoint b) y
b) Finite automata cannot remember arbitarily large c) z
amount of data d) all of the mentioned
c) Even if the mid point is known, it cannot find
whether the second half matches the first Answer: b
d) All of the mentioned Explanation: The lemma says, the portion y in xyz
cannot be zero or empty i.e. |y|>0, this condition
Answer: d needs to be fulfilled to check the conclusion
Explanation: It is the disadvantage or lack of condition.
property of a DFA that it cannot remember an 4. Let w= xyz and y refers to the middle portion
arbitrarily such large amount of data which makes and |y|>0.What do we call the process of repeating
it incapable of accepting such languages like y 0 or more times before checking that they still
palindrome, reversal, etc. belong to the language L or not?
a) Generating
. b) Pumping
c) Producing
Pumping Lemma for Regular Language - d) None of the mentioned
“Pumping Lemma for Regular Language”.
1. Relate the following statement: Answer: b
Statement: All sufficiently long words in a regular Explanation: The process of repeatation is called
language can have a middle section of words pumping and so, pumping is the process we
repeated a number of times to produce a new word perform before we check whether the pumped
which also lies within the same language. string belongs to L or not.
a) Turing Machine 5. There exists a language L. We define a string w
b) Pumping Lemma such that w∈L and w=xyz and |w| >=n for some
c) Arden’s theorem constant integer n.What can be the maximum
d) None of the mentioned length of the substring xy i.e. |xy|<=?
a) n
Answer: b b) |y|
Explanation: Pumping lemma defines an essential c) |x|
property for every regular language in automata d) none of the mentioned
theory. It has certain rules which decide whether a
language is regular or not. Answer: a
2. While applying Pumping lemma over a Explanation: It is the first conditional statement of
language, we consider a string w that belong to L the lemma that states that |xy|<=n, i.e. the
and fragment it into _________ parts. maximum length of the substring xy in w can be n
a) 2 only.
b) 5 6. Fill in the blank in terms of p, where p is the
c) 3 maximum string length in L.
Statement: Finite languages trivially satisfy the
pumping lemma by having n = ______. b) string
a) p*1 c) both (a) and (b)
b) p+1 d) none of the mentioned
c) p-1
d) None of the mentioned Answer: a
Explanation: Given: w =xyz. Here, xyz individually
Answer: b represents strings or rather substrings which we
Explanation: Finite languages trivially satisfy the compute over conditions to check the regularity of
pumping lemma by having n equal to the maximum the language.
string length in l plus 1. 10. Which of the following one can relate to the
7. Answer in accordance to the third and last given statement:
Answer: .
abe*+e(ab)*(Using the identities e=e*, eE=Ee=E)
=ab+(ab)*=> ab will contain inside (ab)*, thus Automata Theory Quiz Online -
=>(ab)*. This set of Automata Theory online quiz focuses on
8. Let h(0)=ab; h(1)=e “Conversions among Representations”.
Let L={abab,baba} 1. Which of the following conversion is not
h-1(L)=_____. feasible?
a) the language of two one’s and any number of a) Regular expression to automaton conversion
zeroes b) Automaton to Regular Expression Conversion
b) the language of two zeroes and any number of c) NFA to DFA
one’s d) None of the mentioned
c) the language of two zeroes and two one’s
d) none of the mentioned Answer: d
Explanation: Each of the four formats of
Answer: b representation of the regular language be it, DFA,
Explanation: h-1(L) is the language with two 0’s NFA, Regular Expression or e-NFA can be
and any number of 1’s=>(1*01*01*). converted to the rest three forms.
9. While proving Inverse Homomorphism, which 2. The computation of e-closure of n-states takes
of the following steps are needed? ______ time.
a) Start with a DFA Ain L a) O(n2)
b) Construct a DFA B for h-1(L) b) O(n3)
c) The set of states, initial and final states should be c) O(2n)
same. d) None of the mentioned
d) All of the mentioned
Answer: b
Answer: d Explanation: We must search from each of the n
Explanation: While constructing DFA B, we need states along all arcs labelled e. If there are n states,
to take care of the following: there can be no more than n2 states.
a) The same set of states 3. For a ___ state DFA, the time taken for DFA-
b) The same start state NFA conversion is O(n).
c) The same final state a) n
d) Input alphabet = the symbols to which b) n1/2
homomorphism h applies. c) n2
10. 8. Let h(0)=ab; h(1)=e d) 2n
Let L={abab,baba}
h-1(L)= the language of two zeroes and any Answer: a
number of one’s. Explanation: The conversion DFA to NFA is
The given example belongs to which of the simple, and takes O(n) time on an n-state DFA.
following?
4. With reference to Automaton to Regular 8. NFA to DFA conversion is done via
Expression Conversion, for each of the n rounds, a) Subset Construction method
where n is the number of states of DFA, we can b) Warshalls Algorithm
_________ the size of the regular expression c) Ardens theorem
constructed. d) None of the mentioned
a) double
b) triple Answer: a
c) quadruple Explanation: Powerset or subset construction
d) none of the mentioned method is a standard method for converting a non
deterministic finite automata into DFA which
Answer: c recognizes the same formal language.
Explanation: We can quadruple the size of the 9. State true or false:
regular expression per round. Thus, we can simply Statement: Regular expression can directly be
write n3 expressions can take time O(n34n), where n converted to DFA without intermediate steps.
=number of states of the DFA. a) true
5. Conversion of regular expression to e-NFA takes b) false
___________ time.
a) linear Answer: b
b) exponential Explanation: There exists subsequent steps like
c) logarithmic formation of epsilon-NFA and NFA before the
d) none of the mentioned formation of corresponding DFA.
10. Is the following statement correct?
Answer: a Statement: Thompson construction is used to
Explanation: It is possible to parse the expression convert Regular expression to finite automata.
efficiently, using a technique that takes only O(n) a) Yes
3
time on a expression of length n . b) No
6. The conversion of NFA to DFA can be done in:
a) exponential time Answer: a
b) linear time Explanation: Thompson’s Construction is used to
c) logarithmic time find out a Finite Automaton from a Regular
d) all of the mentioned Expression. We will reduce the regular expression
into smallest regular expressions and convert them
Answer: a to NFA and finally to DFA.
Explanation: We can eliminate e-transitions from
an n state epsilon-NFA to build an ordinary NFA in To practice all areas of Automata Theory for online
O(n3) time, without changing the number of Quizzes, .
states.Next, producing to DFA can take exponential
time. Testing Emptiness and Membership -
7. Which of the following cannot be converted in “Testing Emptiness and Membership”.
an ordinary NFA? 1. Language classes have the following property:
a) DFA a) Closure property
b) Regular Expression b) Decision property
c) e-NFA c) Both (a) and (b)
d) None of the mentioned d) None of the mentioned
Answer: d Answer: c
Explanation: Each of the following can expressed Explanation: A decision property of a language
in terms of ordinary NFA with different time class is an algorithm that takes a formal description
complexities. of a language(e.g., a DFA) and tells whether or not
some property holds.
2. Which of the following are decision properties? a) Given two languages, are there strings that are in
a) Emptiness both?
b) Infiniteness b) Is the language a subset of another regular
c) Membership language?
d) All of the mentioned c) Is the language same as another regular
language?
Answer: d d) None of the mentioned
Explanation: Emptiness, Infiniteness and
Membership are the decision properties of any Answer: d
language class. Example: Is the language L empty? Explanation: To give a solution to the mentioned
Or Is w, a string belongs to the regular language L? problems, we require decision properties and for
3. Pick the odd one out of the given properties of a some, we need additional tools like minimized
regular language: automaton and Pumping lemma.
a) Kleene 7. Which of the following is a function of Closure
b) Reversal properties?
c) Homomorphism a) Helps construct representations
d) Membership b) Helps show informally described languages not
to be in class
Answer: d c) Both (a) and (b)
Explanation: Membership is a decision property of d) None of the mentioned
language class while others mentioned like Kleene,
Reversal and Homomorphism are Closure Answer: c
properties of language class. Explanation: Using closure properties we can give
4. For an automata, which of the following are a=solution to many problems like :
equivalent variants? Is the regular languages L1 and L2 closed on
DFA,NFA and NFA with epsilon transitions concatenation operation?, etc.
a) DFA and NFA 8. Suppose there is a string w=abbab, and there
b) NFA and epsilon NFA exists a DFA which accepts w. How many stepts
c) DFA and epsilon NFA will be required to test its membership?
d) All of the mentioned a) 2
b) 1
Answer: d c) 4
Explanation: For a given automata, all the formats d) None of the mentioned
of representation be it deterministic finite automata
or non deterministic finite automata or non Answer: If a string belongs to a language, the
deterministic finite automata with epsilon number of steps required to test that member ship is
transitions, all are equivalent variants. equal to the length of string i.e. 5.
5. Which of the following are not meant to specify 9. If a DFA has n states and the language contains
a regular language? any string of length n or more, the language is
a) Regular Expression termed as:
b) DFA a) Infinite
c) NDFA and epsilon-NFA b) Empty
d) All of the mentioned c) Non regular
d) None of the mentioned
Answer: d
Explanation: It is possible to convert from one Answer: The language is surely finite if it is limited
specification to another. We can express a regular to string of length n or less. This is because there
language in all the given four variants. are atleast n+1 states along the path while
6. Which of the following problems do not belong traversing w(string).
to decision properties?
10. State true or false:
Statement: If an n-state DFA accepts a string w of
length n or more, then there must be a state that
appears twice on the path labeled w from the start
state to the final state.
a) true
b) false
Answer: a
Explanation: This occurs because there are atleast
n+1 states along the path while traversing the string
w.