Match the following NFAs with the regular expressions they correspond to:
View worked solution
Answer: C
We can easily match the NFAs to their corresponding regular expressions by analyzing the suffix of each expression (the part after the main loop) and comparing it with the transitions leading to and looping on the final state of each NFA.
Let's examine the suffixes of the four regular expressions:
- Expression 1: Ends with . This corresponds to an NFA where the final state is entered via a -transition and has a self-loop of . This matches P.
- Expression 2: Ends with . This corresponds to an NFA where the final state is entered via a -transition and has no self-loop. This matches Q.
- Expression 3: Ends with . This corresponds to an NFA where the final state is entered via a -transition and has no self-loop. This matches R.
- Expression 4: Ends with . This corresponds to an NFA where the final state is entered via a -transition and has a self-loop of . This matches S.
Thus, the correct matching is P-1, Q-2, R-3, S-4, which corresponds to Option C.
Free practice · Your answers on this page are not saved.
