edited by
1,973 views
0 votes
0 votes

Find regular expressions for the following languages on {a, b}.

(a) L = {w : |w| mod 3 = 0}

(b) L = {w : na (w)mod 3 = 0}

(c) L = {w : na (w)mod 5 > 0}

Also Design DFA for the same.

edited by

2 Answers

0 votes
0 votes
(a) $[(a + b)(a + b)(a + b)]^*$

(b) $(b^*ab^*ab^*ab^*)^* + b^*$

or, $(b^*ab^*ab^*ab^*)^*.b^* $

(c) $[(b^*ab^*ab^*ab^*ab^*ab^*)^* + b^*](ab^* + ab^*ab^* + ab^*ab^*ab^* + ab^*ab^*ab^*ab^*)$

or, $(b^*a+b^*ab^*a+b^*ab^*ab^*a+b^*ab^*ab^*ab^*a)[(b^*ab^*ab^*ab^*ab^*ab^*)^* + b^*]$
edited by

Related questions

1 votes
1 votes
2 answers
2
1 votes
1 votes
2 answers
3