Regular Expressions & Languages

Answer & solution
Answer: C (no official key was published)
1. Name the lower start state L, upper-left state A and upper-right state B. Every automaton accepts ε at L; every nonempty accepted path begins with 0 from L to A. In P, cycles from A back to A are 00 via L or 01*1 via B, and a finishing path to either accepting state is represented by 01*.
2. Hence P matches expression 1: ε+0(01*1+00)*01*. In Q, the A-cycles are 00 or 10*1, with final 0 to L, giving expression 2. In R, the A-cycles are 10 or 10*1, with final 1 to L, giving expression 3.
3. In S, the same cycles apply but B is also accepting, so a final 10* covers both possible accepting destinations, giving expression 4. Thus P–1,Q–2,R–3,S–4, option C.