In this automaton how to find regular expression

- 104,111
- 38
- 209
- 254

- 1
- 1
-
I'm voting to close this question as off-topic because it's about a straightforward application of computer science and unrelated to programming. – Gilles 'SO- stop being evil' Apr 19 '16 at 20:02
1 Answers
There are three methods basically. Two are given in the book by Hopcroft and Ullman.
1) Calucalte R_ij recursively for all states i,j going through only k intermediate states.
2) Calculate regular expression by eliminating states between start state and a single final state. This is simpler than the first method.
3) Analyse and try to understand the DFA itself.
If we eliminate the middle state we have following
a_02 = (aa+ba)*(ab+bb) : Regular expression from state 0 to 2 without using arrow from state 2 to 0. a_00 = (aa+ba)* : Regular expression from state 0 to 0 without using arrow from state 2 to 0.
We can now use the expression given in the textbook but at this stage we can also analyse the automata and come up with a solution. So finally R_02 becomes
((aa+ba)*(ab+bb)(a+b))*(aa+ba)*(ab+bb)

- 186
- 5