Domanda

Hi I am trying to define a language accepted by an FA in simple terms the FA is:

s

I think it is the language with strings

(not starting with ab and not having substring bb and also ending with an a) and also the NULL string

But I do not know if this is the shortest definition or correct at all?

È stato utile?

Soluzione

All the even length strings which do not have 'b' at any of the even positions.

Altri suggerimenti

You are right. The FA defines a language containing all strings with a succession of aa and ba . The strings do not start with ab and never contain a bb. A more concise regex is (aa|ba)*

Any count of ("aa" or "ba") is possible (0 times too).
As regexp ([ab]a)*
In other words: Even count of characters, each odd position is a or b, and the rest only a.
Your definition is lacking the "even count" part, to start with.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top