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
Questions 31–35 of 62
What is the minimum number of states needed in a DFA to recognize L?
Answer: (B)
Take states . State means i a's have been read, counting from the last return. The moves are on a, and goes back to on a. The accepting state is . The empty string is not accepted, so has to stay separate from .
All states are distinguishable. For , the string takes to (accepted), but takes to a state before (rejected). So no state can be merged and the minimum is n + 1.
Answer: (B)
Answer: (B)
- DFA and NFA have the same power (subset construction).
- A deterministic TM and a non-deterministic TM have the same power. A single-tape TM and a multi-tape TM also have the same power.
- A DPDA accepts only deterministic CFLs. An NPDA accepts all CFLs (for example, needs non-determinism).
Answer: DPDA and NPDA
Answer: (C)
Needed: the strings in L have length at most n, so L is finite. In an NFA for a finite language, a shortest accepting path for w cannot repeat a state. A repeat with a non-empty loop could be pumped to accept longer and longer strings, and a loop that reads nothing can be cut out. The path for w reads n symbols, so it goes through at least n + 1 different states.
So the minimum is n + 1.
Answer: (C)
The above DFA accepts the set of all strings over {0,1} that
Answer: (C)
Read the given DFA. From the start state, 1 stays and 0 goes to the middle state. From the middle state, 1 goes back to the start and 0 goes to the final state. From the final state, 0 stays and 1 goes back to the start. So the final state is reached only when the last two symbols read are 00. Now compare with the DFA for each option (items 1 to 4 are options A to D).
- Strings that start with or
Regular expression - Strings that end with
Regular expression - Strings that end with
Regular expression
- Strings that have the substring
Regular expression
The DFA in item 3 is the same as the given DFA, so the given DFA accepts the strings that end with 00. The others do not match. The given DFA rejects the string 0 (it stops in the middle state), but items 1 and 2 accept it. It also rejects 0010 (which contains 00 but ends in 10), but item 4 accepts it.
Answer: (C)
If the initial state is A = 0, B=0, what is the minimum length of an input string which will take the machine to the state A=0, B=1 with Output=1?
Answer: (A)
Look at the next state part of the table.
Each time the machine reaches state , the output is [rows , , ]. So state 00 comes with output 1.
When the machine reaches state , the output is [rows , ] and also [row ]. So state 01 comes with output 0 and with output 1.
When the machine reaches state , the output is [rows , ]. So state 10 comes with output 0.
The machine never reaches state [ does not appear in the next state part]. So state 11 has a don't know (N) output.
Now draw the Moore Machine for this FSM [from the table: present state x input symbol -> next state].
Read the path from the figure, starting at 00/1:
input 1: 00 01 (row 5, output 0)
input 0: 01 10 (row 2, output 0)
input 1: 10 01 with output 1 (row 7), which is state 01/1.
So the input 101 works, and its length is 3.
No shorter string works. Output 1 together with state 01 comes only from state 10 on input 1 (row 7). The other ways into 01 (rows 3 and 5) give output 0. From 00, input 0 stays in 00 and input 1 goes to 01, so state 10 cannot be reached in one step. State 11 is never reached. So reaching 10 takes at least 2 inputs, and the full string takes at least 2 + 1 = 3.
Answer: (A)
Keep practising