Prove that the finite automaton whose transition diagram is as shown in accepts the sets of all strings

Question

Prove that the finite automaton whose transition diagram is as shown in accepts the sets of all strings over the alphabet {a,b} with an equal number of a’s and b’s such that each prefix has at most one more a than the b’s and at most one more b than the a’s.

Trace

Construct a regular expression corresponding to the state diagram described by.

Trace

 

Summary

⦁ In the given fig 1, we have to immediately the pair of (ab)or the pair of (ba). we have finite automation in accepts the sets of strings where every time the ‘a’ appears is followed by the ‘b’, or we can say that every time the ‘b’ appears is followed by the ‘a’. So, in such case, every prefix will always have more than one ‘a’ as compare to the number of ‘b’ or more than one ‘b’ as compared to the number of ‘a’

⦁ The regular expression corresponding to the state diagram is
RE = (0*11*(01)*000*)

Explanation

In the above given Finite Automata we have:

⦁ q1 as both Initial state and Final state.
⦁ Now from our state q1 we are getting ‘a’, and by getting ‘a’ we state q2. Such as by getting ‘b’ we go to state q3.
⦁ From state q2 on getting ‘b’, it will again come to state q1 and from state q3, on getting ‘a’, it will again come to state q1.
⦁ Now here, String with an equal number of ‘a’s and b’s’ will lead you to state q1.

Tracing

Tracing

So, we have string=”abbaaabb”

Here, the prefix we have is “abbaaa” where in total we have 4 ‘a’s and 2 ‘b’s. so not accepting. so immediate pair of ‘a’ and ‘b’ will occur.

Here, every prefix will always have more than one ‘a’ as compare to the number of ‘b’ or more than one ‘b’ as compared to the number of ‘a’.

 

Also read, the Hitmen twins of the Juarez Cartel, Leonel and Marco Salamanca, often known as the “Cousins”

 

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *