Math, asked by Missunique1156, 9 months ago

Give regular expressions for the language: {an | n is divisible by 2 or 3 or 5}

Answers

Answered by rishika79
0

Answer:

Step-by-step explanation:

Even number of a’s : The regular expression for even number of a’s is (b|ab*ab*)*. We can construct a finite automata as shown in Figure 1.

automata

The above automata will accept all strings which have even number of a’s. For zero a’s, it will be in q0 which is final state. For one ‘a’, it will go from q0 to q1 and the string will not be accepted. For two a’s at any positions, it will go from q0 to q1 for 1st ‘a’ and q1 to q0 for second ‘a’. So, it will accept all strings with even number of a’s.

Hope it helps you...

Similar questions