You are on page 1of 5

iii) Generate the related Regular Expression from the NFA, showing all the steps in the

conversion process.

[10 Marks]
Solution:

Regular Expression
Step 1: Add new initial state

Initial State should not have any incoming edge. So, a new Start State is not necessary.

Step 2: Add a new final state.


Step 3: Eliminate all the other final states

Step 4: Eliminate all the other states on by one except initial state and final state.

1)Eliminating states from q2 to q4:

-Elimination of states q2:


-Elimination of states q3:

-Elimination of states q4:

This is the new form of the NFA after the q2 to q4 elimination:


2)Eliminating states from q5 to q11

Elimination of q5:

Elimination of q6:

Elimination of q7:

Elimination of q8:
Elimination of q9:

Elimination of q10:

Step 5: Write Regular Expression

REGEX = w h i l e ( * a , ( ) * : , a , ) ) * β , ) , : ) , : , β β

You might also like