Question
Official answer and solution
- Official answer
- 256
- From
- Official GATE 2021 answer key
Solution
Trace the transitions of the given 6-state DFA to determine which strings of length 8 reach an accepting state.
From the DFA transition diagram:
- Start state is .
- On either input symbol 0 or 1, transitions to (after 1 symbol).
- On either input symbol 0 or 1, transitions to (after 2 symbols).
- On either input symbol 0 or 1, transitions to (after 3 symbols).
State is an accepting state. From , every transition on 0 and 1 leads to states , which are also accepting states, and all transitions from and remain within the set of accepting states .
Thus, any binary string of length at least 3 ends in an accepting state. There are no trap states reachable from .
Since every binary string of length 8 has length , all binary strings of length 8 are accepted by the DFA. The total number of binary strings of length 8 is:
256
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2021 Computer Science and Information Technology - Session 2 (CS2)
- Question
- 27 of 65, printed as CS Q.17
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.