creating regular expressions from given language

62 Views Asked by At

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.

The DFA I've created

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$}\}$

Again, the DFA is

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 + ε

1

There are 1 best solutions below

0
On BEST ANSWER

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 + ε