Finite Automata · Theory of Computation
62 questions · asked in 27 of 27 years (2000–2026)
MCQ 45 · MSQ 5 · NAT 121-mark 34 · 2-mark 28
2000Questions per year2026
Questions 11–15 of 62
Consider the following deterministic finite automaton (DFA)
The number of strings of length 8 accepted by the above automaton is _________
The number of strings of length 8 accepted by the above automaton is _________
Answer: 256
Each path from the start state gets to the final state after exactly 3 symbols (start level 1 level 2 final, taking either symbol at each step). The final state then stays put on both 0 and 1.
So any string of length is accepted. The number of strings of length 8 is .
Answer: 256
So any string of length is accepted. The number of strings of length 8 is .
Answer: 256
Suppose we want to design a synchronous circuit that processes a string of 0's and 1's. Given a string, it produces another string by replacing the first 1 in any subsequence of consecutive 1's by a 0. Consider the following example.
A Mealy Machine is a state machine where both the next state and the output are functions of the present state and the current input.
The above mentioned circuit can be designed as a two-state Mealy machine. The states in the Mealy machine can be represented using Boolean values 0 and 1. We denote the current state, the next state, the next incoming bit, and the output bit of the Mealy machine by the variables s, t, b and y respectively.
Assume the initial state of the Mealy machine is 0.
What are the Boolean expressions corresponding to t and y in terms of s and b?
A Mealy Machine is a state machine where both the next state and the output are functions of the present state and the current input.
The above mentioned circuit can be designed as a two-state Mealy machine. The states in the Mealy machine can be represented using Boolean values 0 and 1. We denote the current state, the next state, the next incoming bit, and the output bit of the Mealy machine by the variables s, t, b and y respectively.
Assume the initial state of the Mealy machine is 0.
What are the Boolean expressions corresponding to t and y in terms of s and b?
Answer: (B)
The state stores the previous bit, so the next state is just the present input bit: t = b.
The output is 1 only when a 1 is not the first 1 of a run. That means the current bit is 1 and the previous bit was also 1: y = sb.
Check with 0011: the outputs are 0, 0, 0, 1. This is correct.
Answer: t = b, y = sb
The output is 1 only when a 1 is not the first 1 of a run. That means the current bit is 1 and the previous bit was also 1: y = sb.
Check with 0011: the outputs are 0, 0, 0, 1. This is correct.
Answer: t = b, y = sb
Consider the following language.
L={ number of a's in x divisible by 2 but not divisible by 3}
The minimum number of states in DFA that accepts L is _______
L={ number of a's in x divisible by 2 but not divisible by 3}
The minimum number of states in DFA that accepts L is _______
Answer: 6
The DFA must keep track of the count of a's mod 2 and mod 3, which means mod 6. This gives 6 states (b's do not change the state).
Accept the counts that are even but not multiples of 3. These are remainders 2 and 4. All 6 states are distinguishable (for example, they differ in how many a's lead to acceptance).
Answer: 6
Accept the counts that are even but not multiples of 3. These are remainders 2 and 4. All 6 states are distinguishable (for example, they differ in how many a's lead to acceptance).
Answer: 6
Let be the set of all bijections from {1,...,5} to {1,...,5}, where denotes the identity function, i.e. . Let denote composition on functions. For a string , let . Consider the language . The minimum number of states in any DFA accepting L is _________ .
Answer: 120
The DFA only has to remember the composition of the symbols read so far. This is one of the permutations of {1, , 5}. The start state is id, and it is also the only final state.
All 120 states can be told apart. Take any state . If the DFA reads from there, it goes to id. From no other state does that symbol lead to id. So the minimum number of states is 120.
Answer: 120
All 120 states can be told apart. Take any state . If the DFA reads from there, it goes to id. From no other state does that symbol lead to id. So the minimum number of states is 120.
Answer: 120
Let N be an NFA with n states. Let k be the number of states of a minimal DFA which is equivalent to N. Which one of the following is necessarily true?
Answer: (D)
Use the subset construction to change an n-state NFA into a DFA. Each DFA state is a subset of the NFA's states, so there are at most of them. Minimizing never adds states, so always holds.
The other options can fail:
- (A) and (B) fail when the minimal DFA is much smaller. For example, an n-state NFA that accepts all strings has a 1-state minimal DFA.
- (C) fails for NFAs that really need the subsets. The language "the (n-1)th symbol from the end is 1" has an n-state NFA, but its minimal DFA needs states, which is more than for .
Answer: (D)
The other options can fail:
- (A) and (B) fail when the minimal DFA is much smaller. For example, an n-state NFA that accepts all strings has a 1-state minimal DFA.
- (C) fails for NFAs that really need the subsets. The language "the (n-1)th symbol from the end is 1" has an n-state NFA, but its minimal DFA needs states, which is more than for .
Answer: (D)
Keep practising