-1

I am asked to find

Prove that the following languages are regular languages:

(a) $\{a^nb^ma^k \mid n\geq3,m\geq1,k\geq1\}$

(b) $\{a^n \mid n\neq3 \text{ and } n\not\equiv2 \mod7\}$

(c) $\{a^nb \mid n\geq2\}\cup\{ab^m \mid m≥3\}$

I have a vague understanding of pumping lemma, and how to prove a language is not regular, but was hoping that someone could walk through (a) with me to give me a better understanding and allow me to do the rest on my own. I think I must make an automaton but I am not sure how, as this does not seem finite to me?

tyuip
  • 21
  • 3

1 Answers1

0

Note that the language in (a) consists of strings that start with $\mathtt{aaaa}^r\dotsc$ where $r\ge 0$. Make use of the idea that a state in a FA can "record" the answer to a yes/no question. To process the first part, use a FA with four states, $$\begin{align} q_0:&\text{ we've seen $0\ \mathtt{a}$'s so far}\\ q_1:&\text{ we've seen $1\ \mathtt{a}$ so far}\\ q_2:&\text{ we've seen $2\ \mathtt{a}$'s so far}\\ q_3:&\text{ we've seen $3$ or more $\mathtt{a}$'s so far}\\ \end{align}$$ Obviously, in state $q_0$ on input $\mathtt{a}$, we'll go to state $q_1$, in state $q_1$ on an $\mathtt{a}$ we'll go to state $q_2$, in state $q_2$ on an $\mathtt{a}$ we'll go to state $q_3$ and in state $q_3$ on an $\mathtt{a}$ we'll stay in state $q_3$. That takes care of the first part, $\mathtt{a}^n$ where $n\ge 3$. Do the same thing for the other two parts and you'll have a FA for the language.

Rick Decker
  • 15,016
  • 5
  • 43
  • 54