how to solve equation with epsilon

275 Views Asked by At

i am working on a problem for Regular expression and it resulted to this

$\epsilon + a+b + aa+ab + ba + bb$

now when i solved it further and reached here

$\epsilon + a + b + (a+b)(a+b)$ the solution is $(a+b+\epsilon)(a+b+\epsilon)$ , how to reach to this

1

There are 1 best solutions below

3
On BEST ANSWER

Using distributive, associative, idempotent properties, we have: \begin{eqnarray} \epsilon + a+b + aa+ab + ba + bb &=& \epsilon + (a+b) + (a+b)(a+b) \\ &=& \epsilon + \epsilon + \epsilon(a+b) + (a+b)\epsilon+ (a+b)(a+b) \\ &=& \epsilon\epsilon + \epsilon(a+b) + (a+b)\epsilon+ (a+b)(a+b) \\ &=& (a+b+\epsilon)(a+b+\epsilon) \end{eqnarray}