# creating regular expressions from given language

The first question is $$L_1 = \{w \in \{a,b,c\}^∗ \mid \text{w ends with ca}\}$$

I started by creating a DFA for that for better understanding and then making a regular expression.

and the regular expression for this is (NOTE:'*' = iteration ): $$[(a+b)^*c(a+b)a]$$ before I created the DFA my intuition was $$(a+b+c)^*ca$$

The second question is $$L_2 = \{w \in \{a,b,c\}^∗ \mid \text{w doesn't contain cba}\}$$

And the regular expression is: $$[(a+b)^*(c^*a)(b^*c)a(a+b+c)^*]$$

SOLVED: For the first question - instead of creating DFA I've made NFA

NFA HERE

And the regular expression for this is: (a+b+c)* ca

For the second question, I've used the blocking method. The regular expression is: (b+a)* (cr)* r = (bb+a)(b+a)* + b + ε

• @J.-E.Pin Yes, It went wrong with the * Commented Apr 5, 2022 at 12:25
• That first diagram has does not show transition on input c from state $q_1$. It also has two transitions on input a from state $q_1$.
– MJD
Commented Apr 5, 2022 at 14:36

For the first question - instead of creating DFA I've made NFA

NFA HERE

And the regular expression for this is: (a+b+c)* ca

For the second question, I've used the blocking method. The regular expression is: (b+a)* (cr)* r = (bb+a)(b+a)* + b + ε