GATE Computer ScienceVery hardGATE CS

In the Thompson NFA for (a*|b*)*, each symbol machine has 2 states and 1 non-ε edge; union and star add a new start and final state with 4 new ε-edges each (start to both/inner start and inner final to both/the new final, plus the loop-back edge for star). How many ε-transitions does the whole NFA have?

  1. A. 18
  2. B. 14
  3. C. 12
  4. D. 16

Correct answer: D. 16

a* has 4 ε-edges (star adds 4), and so does b*. The union adds 4 more: 4 + 4 + 4 = 12. The outer star adds 4 more: 16. Symbol machines contribute no ε-edges.

More Compiler Design questions

Exams that ask this topic