GATE | GATE CS 2008 | Question 52
Match the following NFAs with the regular expressions they correspond to
1. ϵ + 0(01*1 + 00) * 01* 2. ϵ + 0(10 *1 + 00) * 0 3. ϵ + 0(10 *1 + 10) *1 4. ϵ + 0(10 *1 + 10) *10 *

(A) P – 2, Q – 1, R – 3, S – 4
(B) P – 1, Q – 3, R – 2, S – 4
(C) P – 1, Q – 2, R – 3, S – 4
(D) P – 3, Q – 2, R – 1, S – 4
Answer: (C)
Explanation: Trick: Here we see in all the given figures then second state has a loop over the input alphabets. In such cases we should resolve the loop at that state and transform the NFA into a simpler one to get a regular expression for the NFA.
For resolving the loop, first reach the state where loop is to be resolved then draw all loops over that state and all possible movements to move to the final state.
Figure P: (when loop resolved at middle state)
Loop at middle state is either by a 00 or a 01*1.
Hence the regular expression: € + 0(00 +01*1)* 01*
Figure Q: (when loop resolved at middle state)
Loop at middle state is either by a 00 or a 10*1.
Hence the regular expression: € + 0(00 +10*1)* 0.
Figure R: (when loop resolved at middle state)
Loop at middle state is either by a 10 or a 10*1.

Hence the regular expression: € + 0(10 +10*1)* 1.
Figure S: (when loop resolved at middle state)
Loop at middle state is either by a 10 or a 10*1.
Hence the regular expression: € + 0(10 +10*1)* 10*.
The regular expressions matching with the above gives suitable matching as P-1, Q-2, R-3, S-4
This explanation has been contributed by Yashika Arora.
Quiz of this Question
Recommended Posts:
- GATE | Gate IT 2008 | Question 22
- GATE | Gate IT 2008 | Question 34
- GATE | Gate IT 2008 | Question 35
- GATE | Gate IT 2008 | Question 36
- GATE | Gate IT 2008 | Question 37
- GATE | Gate IT 2008 | Question 38
- GATE | Gate IT 2008 | Question 39
- GATE | Gate IT 2008 | Question 40
- GATE | Gate IT 2008 | Question 41
- GATE | Gate IT 2008 | Question 42
- GATE | Gate IT 2008 | Question 43
- GATE | Gate IT 2008 | Question 44
- GATE | Gate IT 2008 | Question 45
- GATE | Gate IT 2008 | Question 46
- GATE | Gate IT 2008 | Question 32




