is language accepted by finte state automaton

54 Views Asked by At

Hi I need to prove these languages are accepted or not by the following finite state automata.

for 1 does this mean that we need an even number of a's or that a is literally 2,4,6,8....etc

also for 2 I know how to do this for "and" but not quite sure how to do it for "or".

Thanks for any help in advance.

1

There are 1 best solutions below

1
On

For a word $w\in\{a,b\}^*$, $|w|_a$ is the number of $a$s in $w$. Thus, $L_1$ is the set of all strings of $a$s and $b$s having an even number of $a$s. (Note that $0$ is even.) $L_2$ the set of all strings of $a$s and $b$s having an even number of $a$s, an even number of $b$s, or both. In other words, the only strings of $a$s and $b$s that are not in $L_2$ are those that have an odd number of $a$s and an odd number of $b$s. $L_3$ is the set of strings having the same number of $a$s as $b$s.

HINT: For $(1)$ it’s not hard to design an automaton that accepts $w$ if and only if $w$ has an even number of $a$s. In fact, you can do it with an automaton that has only two states.

For $(2)$ there is a four-state automaton. It may help you to see how to connect them if you label the states $q_{even,even},q_{even,odd},q_{odd,even}$, and $q_{odd,odd}$ and arrange matters so that the automaton is in state $q_{even,odd}$ when the number of $a$s read so far is even and the number of $b$s read so far is odd, and similarly for the other three states.

For $(3)$, try applying the pumping lemma to the word $a^pb^p$, where $p$ is the presumed pumping length.