FOR FREE CONTENT

Here we calculate regular expression of the given machine:

 

 

This machine has two final state q1 and q2.

Here for q1 final state we have two distinct path to calculate regular expression so, it sum of two regular expression for two distinct path and same for q2 also.

 

Regular expression for q1:

 

RE1 = a(a + aa*b)* + b(a + ba*a)*ba* 

 

Regular expression for q2:

 

RE2 = b(a + ba*a)* + a(a + aa*b)*aa* 

 

Regular expression for machine:

 

RE = RE1 + RE2

 

RE = a(a + aa*b)* + b(a + ba*a)*ba* + b(a + ba*a)* + a(a + aa*b)*aa*

 

= a(a + aa*b)* (λ + aa*) + b(a + ba*a)* (λ + ba*)

 

= a(a + aa*b)* + b(a + ba*a)* (λ + ba*)         [Therefore, (λ + aa*) = a*]