All the even length strings which do not have 'b' at any of the even positions.
Finite Automata Definition of language
-
15-10-2022 - |
Pergunta
Hi I am trying to define a language accepted by an FA in simple terms the FA is:
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?
Solução
Outras dicas
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.