Question
Official answer and solution
- Official answer
- B
- From
- Official GATE 2024 answer key
Solution
Analyze the accepting paths from start state 1 to accepting state 2 and accepting state 5.
The NFA has two accepting states, and :
- Strings accepted at state 2: From state , take to state , and cycle between states and on pairs of
0s. This accepts . - Strings accepted at state 5 via state 3: From state , take to state , read an odd number of
0s () to reach state , take to state , and cycle between states and on pairs of1s (). This accepts . - Strings accepted at state 5 via state 4: From state , take to state , read
1to reach state , and cycle between and on . This accepts .
Taking the union of all three sets of accepted strings:
Notice that already contains (when ), and . Hence:
Final answer
Option (B)
Common trap
Thinking cannot be replaced by without noticing that odd-length strings of 0s () are accepted at state 5 via the -transition .
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2024 Computer Science and Information Technology - Set 2 (CS2)
- Question
- 41 of 65
- 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.