Automata PDF
Automata PDF
In a Deterministic Finite State Machine (DFA), for each input symbol, there is exactly:
A) One possible next state
B) Two possible next states
C) Three possible next states
D) No next state
Answer: A
The equivalence between a Deterministic Finite Automaton (DFA) and a Non-Deterministic Finite Automat
on (NDFA) is related to which concept?
A) P vs. NP
B) Turing completeness
C) Pumping Lemma
D) Regular languages
Answer: D
Regular languages are a subset of which class of languages in formal language theory?
A) Context-Free Languages
B) Context-Sensitive Languages
C) Recursive Languages
D) Chomsky Languages
Answer: A
The equivalence between Deterministic and Non-Deterministic Finite Automata (DFA and NDFA) is based
on:
A) The Church-Turing thesis
B) The pumping lemma
C) The Myhill-Nerode theorem
D) The Halting problem
Answer: C
The equivalence between DFA and NDFA is related to which concept in formal language theory?
A) Pumping Lemma
B) Context-Free Grammars
C) Regular Expressions
D) Myhill-Nerode Theorem
Answer: D
In a DFA, what happens when there is no defined transition for an input symbol?
A) The automaton halts.
B) The automaton moves to the initial state.
C) The automaton rejects the input.
D) The automaton accepts the input.
Answer: C
The equivalence between Deterministic and Non-Deterministic Finite Automata (DFA and NDFA) is based
on:
A) The Church-Turing thesis.
B) The pumping lemma.
C) The Myhill-Nerode theorem.
D) The Halting problem.
Answer: C
The equivalence between DFA and NDFA is related to which concept in formal language theory?
A) Pumping Lemma.
B) Context-Free Grammars.
C) Regular Expressions.
D) Myhill-Nerode Theorem.
Answer: D
In a DFA, what happens when there is no defined transition for an input symbol?
A) The automaton halts.
B) The automaton moves to the initial state.
C) The automaton rejects the input.
D) The automaton accepts the input.
Answer: C
Numerical
How many states are there in a DFA that recognizes the language L = {0, 1} where the number of 0s is di
visible by 3?
A) 2
B) 3
C) 4
D) 5
Answer: B
If a DFA has 5 states, and the alphabet contains 4 symbols, how many transitions are there in the DFA?
A) 10
B) 15
C) 20
D) 25
Answer: C
Calculate the number of states in the minimized DFA for the regular expression (0 + 1)*.
A) 1
B) 2
C) 3
D) 4
Answer: B
If an NDFA has 3 states and 2 possible transitions for each input symbol, how many possible transition co
nfigurations are there?
A) 4
B) 6
C) 8
D) 12
Answer: A
Given an alphabet Σ = {a, b, c}, how many strings of length 4 can be generated from Σ?
A) 27
B) 64
C) 81
D) 256
Answer: C
Calculate the number of states required in a DFA to recognize the language L = {0^n1^n | n ≥ 1}.
A) 2
B) 3
C) 4
D) 5
Answer: B
If a Moore machine has 4 states and each state can produce 2 different outputs, how many distinct output
sequences can it generate for a given input sequence?
A) 8
B) 16
C) 32
D) 64
Answer: B
Determine the number of possible strings in the regular language L = {ab, ba, aab, bba}.
A) 2
B) 3
C) 4
D) 5
Answer: C
How many states are there in the minimized DFA for the regular expression (01 + 10)*?
A) 1
B) 2
C) 3
D) 4
Answer: B
Given an alphabet Σ = {x, y, z}, how many different strings of length 3 can be formed?
A) 6
B) 9
C) 27
D) 81
Answer: C
Calculate the number of strings of length 5 that can be generated from the alphabet {0, 1, 2}.
A) 15
B) 81
C) 125
D) 243
Answer: D
In a Mealy machine, if there are 4 states and each state can produce 3 different outputs, how many distin
ct output sequences can it generate for a given input sequence of length 3?
A) 9
B) 12
C) 27
D) 81
Answer: D
How many transitions are there in a DFA that recognizes the language L = {0, 1, 2}?
A) 6
B) 9
C) 12
D) 15
Answer: D
Determine the number of possible strings in the language L = {aa, bb, ab, ba}.
A) 2
B) 3
C) 4
D) 5
Answer: C
Calculate the total number of states in a DFA that recognizes the language L = {w | w is a binary string wit
h an even number of 1s}.
A) 1
B) 2
C) 3
D) 4
Answer: B
If an NDFA has 3 states and 3 possible transitions for each input symbol, how many possible transition co
nfigurations are there?
A) 9
B) 18
C) 27
D) 81
Answer: C
Determine the number of strings in the regular language L = {abc, def, ghi}.
A) 2
B) 3
C) 4
D) 6
Answer: B
How many states are there in the minimized DFA for the regular expression (00 + 11)*?
A) 1
B) 2
C) 3
D) 4
Answer: B
Given an alphabet Σ = {A, B, C}, how many different strings of length 4 can be formed?
A) 12
B) 27
C) 64
D) 81
Answer: D
Calculate the number of strings in the language L = {a^n | n is a prime number}.
A) Infinite
B) 1
C) 2
D) 3
Answer: A
Unit 2
What does NDFA stand for in the context of regular expressions and automata?
A) Non-Deterministic Finite Automaton
B) Null-Deterministic Finite Automaton
C) Non-Deterministic Finite Algorithm
D) None of the above
Answer: A
What is the purpose of constructing a deterministic finite automaton (DFA) equivalent to a regular express
ion?
A) To simplify the regular expression
B) To add null moves to the DFA
C) To minimize the number of states
D) To make the automaton non-deterministic
Answer: C
Which theorem is used to prove that two regular expressions are equivalent?
A) Pumping Lemma
B) Myhill-Nerode Theorem
C) Arden's Theorem
D) Kleene's Theorem
Answer: B
What does NDFA stand for when considering null moves in finite automata?
A) Non-Deterministic Finite Automaton
B) Null-Deterministic Finite Automaton
C) Non-Deterministic Finite Algorithm
D) Null-Deterministic Finite Algorithm
Answer: B
What is the primary function of the transition system containing null moves in regular expressions?
A) To eliminate null moves from finite automata
B) To add null moves to finite automata
C) To convert regular expressions to context-free grammars
D) To simplify regular expressions
Answer: B
Which theorem is used for constructing finite automata equivalent to a regular expression?
A) Arden's Theorem
B) Pumping Lemma
C) Kleene's Theorem
D) Myhill-Nerode Theorem
Answer: A
What is the main purpose of converting non-deterministic systems to deterministic systems in automata th
eory?
A) To simplify regular expressions
B) To eliminate null moves
C) To make the automaton non-regular
D) To improve computational efficiency
Answer: D
Which of the following is a valid regular expression for matching any string of digits?
A) [0-9]+
B) (0-9)*
C) [0-9]*
D) [0-9]?
Answer: C
Which closure property allows you to combine two regular sets to create a new regular set?
A) Concatenation
B) Intersection
C) Complement
D) Exponentiation
Answer: A
In the context of regular expressions, what does the "*" operator represent?
A) Intersection
B) Kleene closure (zero or more repetitions)
C) Union
D) Complement
Answer: B
What does the Pumping Lemma for Regular Sets state about certain strings within a regular language?
A) All strings can be pumped to infinite length.
B) All strings have exactly one unique parse tree.
C) There exist strings that cannot be pumped to longer lengths while remaining in the language.
D) All strings can be pumped to a shorter length.
Answer: C
Which of the following is a non-deterministic finite automaton (NDFA) with null moves?
A) An automaton that can move to multiple states simultaneously
B) An automaton that always moves to the null state
C) An automaton that can move without consuming input
D) An automaton that cannot move between states
Answer: C
What is the purpose of the "Pumping Lemma" in the theory of regular sets?
A) To simplify regular expressions
B) To prove that certain languages are regular
C) To generate null moves in finite automata
D) To find the intersection of two regular expressions
Answer: B
Which operation allows you to combine two regular expressions to match either one or the other?
A) Intersection
B) Concatenation
C) Union
D) Kleene closure
Answer: C
What does Arden's Theorem provide a method for in the context of regular expressions?
A) Converting regular expressions to context-free grammars
B) Simplifying regular expressions with null moves
C) Adding null moves to finite automata
D) Determinizing non-deterministic systems
Answer: B
Which closure property allows you to find the intersection of two regular sets?
A) Concatenation
B) Union
C) Intersection
D) Complement
Answer: C
What is the primary purpose of constructing a deterministic finite automaton (DFA) equivalent to a regular
expression?
A) To simplify the regular expression
B) To make the automaton non-deterministic
C) To add null moves to the DFA
D) To minimize the number of states
Answer: D
What is the main goal of the Pumping Lemma for Regular Sets?
A) To simplify regular expressions
B) To prove that certain languages are context-free
C) To find the intersection of two regular expressions
D) To demonstrate that certain languages are not regular
Answer: D
Which closure property allows you to combine two regular sets end-to-end?
A) Concatenation
B) Union
C) Intersection
D) Complement
Answer: A
What is the primary function of the transition system containing null moves in regular expressions?
A) To eliminate null moves from finite automata
B) To add null moves to finite automata
C) To convert regular expressions to context-free grammars
D) To simplify regular expressions
Answer: B
Which theorem is used for constructing finite automata equivalent to a regular expression?
A) Arden's Theorem
B) Pumping Lemma
C) Kleene's Theorem
D) Myhill-Nerode Theorem
Answer: A
What is the purpose of converting non-deterministic systems to deterministic systems in automata theory?
Which of the following is a valid regular expression for matching any string of digits?
A) [0-9]+
B) (0-9)*
C) [0-9]*
D) [0-9]?
Answer: C
Which closure property allows you to combine two regular sets to create a new regular set?
A) Concatenation
B) Intersection
C) Complement
D) Exponentiation
Answer: A
In the context of regular expressions, what does the "*" operator represent?
A) Intersection
B) Kleene closure (zero or more repetitions)
C) Union
D) Complement
Answer: B
What does the Pumping Lemma for Regular Sets state about certain strings within a regular language?
A) All strings can be pumped to infinite length.
B) All strings have exactly one unique parse tree.
C) There exist strings that cannot be pumped to longer lengths while remaining in the language.
D) All strings can be pumped to a shorter length.
Answer: C
Which of the following is a non-deterministic finite automaton (NDFA) with null moves?
A) An automaton that can move to multiple states simultaneously
B) An automaton that always moves to the null state
C) An automaton that can move without consuming input
D) An automaton that cannot move between states
Answer: C
What is the purpose of the "Pumping Lemma" in the theory of regular sets?
A) To simplify regular expressions
B) To prove that certain languages are regular
C) To generate null moves in finite automata
D) To find the intersection of two regular expressions
Answer: B
NUMERICAL BASED
How many strings of length 5 can be generated from the regular expression (01)*?
A) 16
B) 32
C) 64
D) 128
Answer: B
If the regular expression (a|b)* is used, how many different strings of length 4 are valid matches?
A) 8
B) 16
C) 32
D) 64
Answer: D
When converting the regular expression 0(01)* into an equivalent nondeterministic finite automaton (NFA)
with null moves, how many states will the NFA have?
A) 2
B) 3
C) 4
D) 5
Answer: B
For the regular expression (ab|cd)*, what is the minimum number of states required in the corresponding
deterministic finite automaton (DFA)?
A) 4
B) 8
C) 16
D) 32
Answer: C
If you compute the intersection of two regular languages: L1 = {0, 00, 000, ...} and L2 = {1, 11, 111, ...}, ho
w many strings will be in the intersection?
A) Infinite
B) None
C) Only one string
D) Two strings
Answer: B
Given the regular expression (a|b)*, how many different strings of length 5 can be generated?
A) 16
B) 32
C) 64
D) 128
Answer: D
If a regular expression represents all even-length strings over the alphabet {0, 1}, how many strings of len
gth 6 will it match?
A) 16
B) 32
C) 64
D) 128
Answer: C
Consider the regular expression (0|1)*. How many strings of length 7 can be generated from this expressi
on?
A) 64
B) 128
C) 256
D) 512
Answer: C
If a regular language contains 20 strings, and each string has a length of 3, how many strings of length 4
can be generated from this language using concatenation?
A) 20
B) 40
C) 60
D) 80
Answer: B
How many different strings can be generated from the regular expression (ab)*?
A) Infinite
B) None
C) One
D) Two
Answer: C
If a regular language contains 10 strings of length 5, how many strings of length 2 can be generated from
this language using concatenation?
A) 100
B) 50
C) 10
D) 20
Answer: C
If you concatenate two regular expressions, one matching strings of length 2 and the other matching strin
gs of length 3, how many strings of length 5 can be generated from the resulting expression?
A) 6
B) 9
C) 10
D) 15
Answer: B
If a regular expression matches all strings of length 3 or 4, how many strings of length 5 will it match?
A) 0
B) 16
C) 32
D) 64
Answer: A
If a regular expression matches strings of the form "abc" followed by any number of "xyz," how many strin
gs of this form are in the language?
A) Infinite
B) None
C) One
D) Two
Answer: C
How many different strings can be generated from the regular expression (01|10)*?
A) Infinite
B) None
C) One
D) Two
Answer: A
If a regular expression matches strings of the form "ab" followed by "cd," how many strings of this form ar
e in the language?
A) Infinite
B) None
C) One
D) Two
Answer: D
If you concatenate a regular expression matching strings of length 2 with a regular expression matching st
rings of length 3, how many strings of length 6 can be generated from the resulting expression?
A) 6
B) 9
C) 10
D) 15
Answer: A
If a regular expression matches all strings of length 2 or 3, how many strings of length 4 will it match?
A) 0
B) 16
C) 32
D) 64
Answer: A
How many different strings can be generated from the regular expression (01|10)*?
A) Infinite
B) None
C) One
D) Two
Answer: A
If a regular expression matches strings of the form "ab" followed by "cd," how many strings of this form ar
e in the language?
A) Infinite
B) None
C) One
D) Two
Answer: D
Unit 3
Regular Grammars
What is the Kleene star (*) operation used for in regular expressions?
a) Denoting optional characters
b) Denoting alternative choices
c) Denoting concatenation
d) Denoting repetition zero or more times
Answer: d) Denoting repetition zero or more times
Which type of regular grammar generates a language that can be read from left to right?
a) Left-linear regular grammar
b) Right-linear regular grammar
c) Both left-linear and right-linear regular grammars
d) Neither left-linear nor right-linear regular grammars
Answer: b) Right-linear regular grammar
Which type of regular grammar generates a language that can be read from left to right?
a) Left-linear regular grammar
b) Right-linear regular grammar
c) Both left-linear and right-linear regular grammars
d) Neither left-linear nor right-linear regular grammars
Answer: b) Right-linear regular grammar
Which type of regular grammar generates a language that can be read from left to right?
a) Left-linear regular grammar
b) Right-linear regular grammar
c) Both left-linear and right-linear regular grammars
d) Neither left-linear nor right-linear regular grammars
Answer: b) Right-linear regular grammar
Which type of regular grammar generates a language that can be read from left to right?
a) Left-linear regular grammar
b) Right-linear regular grammar
c) Both left-linear and right-linear regular grammars
d) Neither left-linear nor right-linear regular grammars
Answer: b) Right-linear regular grammar
Numerical Questions
How many productions are in a regular grammar that generates the language {a, b}?
a) 2
b) 3
c) 4
d) Infinite
Answer: a) 2
What is the minimum number of states required for a finite automaton to accept the language L = {0, 1}?
a) 1
b) 2
c) 3
d) 4
Answer: b) 2
If a regular expression has 4 symbols (e.g., a, b, c, d), how many possible strings can it generate of length
3 or less?
a) 64
b) 32
c) 16
d) 8
Answer: c) 16
How many states are in the minimal DFA that accepts the language L = {w | w contains an even number o
f 1s} over the alphabet {0, 1}?
a) 1
b) 2
c) 3
d) 4
Answer: b) 2
If a context-free grammar has 5 non-terminals and 8 productions, how many terminals can it have at most
?
a) 4
b) 5
c) 6
d) 7
Answer: c) 6
How many different strings of length 5 can be generated using an alphabet with 4 symbols?
a) 20
b) 25
c) 64
d) 1024
Answer: d) 1024
If a regular grammar has 3 non-terminals and 6 productions, how many terminals can it have at most?
a) 3
b) 4
c) 5
d) 6
Answer: b) 4
What is the maximum number of states in a non-deterministic finite automaton (NFA) with n states?
a) n
b) 2^n
c) n!
d) 2n
Answer: b) 2^n
If a regular expression has 3 symbols (e.g., x, y, z), how many possible strings can it generate of length 2
or less?
a) 9
b) 6
c) 3
d) 1
Answer: a) 9
How many strings of length 4 can be generated using an alphabet with 3 symbols?
a) 12
b) 16
c) 81
d) 64
Answer: b) 16
If a context-free grammar has 4 non-terminals and 10 productions, how many terminals can it have at mo
st?
a) 3
b) 4
c) 5
d) 6
Answer: c) 5
What is the maximum number of states in a deterministic finite automaton (DFA) that accepts the languag
e L = {w | w has at most two 1s} over the alphabet {0, 1}?
a) 1
b) 2
c) 3
d) 4
Answer: c) 3
How many different strings of length 6 can be generated using an alphabet with 5 symbols?
a) 15625
b) 7776
c) 46,656
d) 10,000
Answer: a) 15625
If a regular grammar has 2 non-terminals and 4 productions, how many terminals can it have at most?
a) 1
b) 2
c) 3
d) 4
Answer: b) 2
What is the minimum number of states required for a finite automaton to accept the language L = {w | w h
as an odd number of 1s} over the alphabet {0, 1}?
a) 1
b) 2
c) 3
d) 4
Answer: b) 2
If a context-free grammar has 6 non-terminals and 12 productions, how many terminals can it have at mo
st?
a) 5
b) 6
c) 7
d) 8
Answer: b) 6
How many different strings of length 3 can be generated using an alphabet with 2 symbols?
a) 2
b) 4
c) 6
d) 8
Answer: b) 4
What is the maximum number of states in a non-deterministic finite automaton (NFA) with 4 states?
a) 4
b) 8
c) 16
d) 32
Answer: d) 32
If a regular expression has 2 symbols (e.g., p, q), how many possible strings can it generate of length 4 or
less?
a) 16
b) 8
c) 4
d) 2
Answer: a) 16
How many strings of length 5 can be generated using an alphabet with 6 symbols?
a) 30
b) 125
c) 7776
d) 15625
Answer: c) 7776