Regular expression to NFA -- confusing regular expressions-:

1 reply · 2K views · last reply
shivajikobardan
Messages
637
Reaction score
54
Homework Statement
Regular expression to NFA -- confusing regular expressions-:
Relevant Equations
none
R=(01+010)*
For it I made the below nfa which i believe seems correct. Plus the tutorials that I am following also make sure it’s correct. Q0 is initial state(forgot to mention in figure).
Handwritten NFA for the regular expression (01 U 010)*, with states q0, qx, qy, qz; loops labelled 01 and 010 at q0, and edges labelled 0 and 1 among the lower states.


R=(01)*+(010)*

But idk how to convert this to NFA
What will be languages accepted by this NFA? Won’t it be the same as the above one?

(for some different question)
I got small hint about this. It was to add epsilon transition, but I don’t understand the need for it.
NFA diagram with states q0 to q5: q0 has an epsilon transition to q1 and to q3, q1 is accepting with a loop-back path via a and b to q2, q3 to q4 and q5 with a and b transitions.

Source-: https://www.cs.wcupa.edu/rkline/fcs/nfas.html
 
shivajikobardan said:
But idk how to convert this to NFA
I don't know is not good enough: make a start and show your efforts.

shivajikobardan said:
What will be languages accepted by this NFA? Won’t it be the same as the above one?
Test both expressions with the string 01010.

shivajikobardan said:
(for some different question)
I got small hint about this. It was to add epsilon transition, but I don’t understand the need for it.
The material you linked includes exactly the same pair of expressions as you have, just with different symbols. The need for the epsilon transition is to deal with the fact that (01+010)* (Example 2 (ab∪aba)*) is different from (01)*+(010)* (Example 3 (ab)*∪(aba)*. Work through that material and the examples until you understand it.
 
  • Like
Likes   Reactions: Jarvis323 and sysprog