i have a reguler expresion
10+(0+11)*1
how to change the reguler expression to Finite State Automata ?
i have a reguler expresion
10+(0+11)*1
how to change the reguler expression to Finite State Automata ?
There are algorithms used in the propf of equivalency between REs and NFAs on the one hand, and between NFAs and DFAs on the other. That is one option and does not require insight or understanding about what language the RE generates.
Another option is to try to understand the language first, and then write a DFA for the language from scratch.
The way I will show you involves the Myhill-Nerode theorem which says a regular language has as many equivalence classes over the indististinguishability relation as there are states in a minimal DFA for that language. Two strings qre indistinguishable with respect yo the language if the same set of strings can be appended to them to get some string in the language. For instance, the strings a, b and ba are distinguishable w.r.t. L(ab) since a can be followed b, b by the empty string only, and ba by nothing (empty set) to get a string in L. This tells us a minimal DFA for ab requires at least three states.
For your language, L(10 + (0 + 11)*1, we observe:
the empty string is the first we look at. It needs a state - the DFA's initial state - and can be followed by any string in L to get a string in L. Call this state [e].
the string 0 can be followed by 1 to get a string in the language; this makes it fifferent from the empty string, so a new state is required. Call this [0].
the string 1 can be followed by the empty string to get another string in the language; this makes it distinguishable from the empty string and the string 0. Call its state [1].
the string 00 can be followed by exactly the same strings as could follow 0 to get a string in the language. This means 00 does not need a new state; 00 will take our DFA to state [0].
the string 01 can be followed by strings of the form 1(0 + 11)*1 to get a string in the language. This is new, so we need a new state. Call this [01]
the string 10 can be followed by the empty string only to get a string in L. This is new, so call its state [10].
the string 11 can be followed by exactly the same strings as could follow 0 to get a string in the language. 11 will take our DFA to state [0].
the string 010 can't ever lead to a string in the language; it must lead to a dead state in our minimal DFA. Call this [010].
the string 011 is indistinguishable from strings 0 and 11.
the strings 100 and 101 can't lead to a string in the language, so it must take our DFA to the dead state [010].
The states we found we needed are these: [e], [0], [1], [01], [10] and [010]. The transitions are not too hard to figure out:
You now have a minimal DFA for your language, as well as a proof of such minimality.