-3

Suppose that $A$ is a regular language. How can I show that $A^2 = A \cdot A$ is a regular language? Is there a construction?

Raphael
  • 73,212
  • 30
  • 182
  • 400
amit
  • 101
  • 1

1 Answers1

5

This holds more generally:

Theorem. If $X$ and $Y$ are regular languages, then their concatenation $$ X\cdot Y = \{xy\mid x\in X, y\in Y\} $$ is regular. This is a standard result that can be found in almost any introduction to regular languages. The idea (it's Theorem 1.4.7 in the linked notes) is to have finite automata $M_X, M_Y$ for languages $X$ and $Y$ and then construct a new FA for $X\cdot Y$ by "gluing" the final states of $M_X$ to the start state of $M_Y$ by $\epsilon$-moves.

The intuition here is that unlike the language $$ 2A=\{aa \mid a\in A\} $$ where a machine to recognize a word in $2A$ would have to "remember" $a$ and somehow determine that the first half matches the second half, no such burden holds for $A\cdot A$: all a recognizer has to do is nondeterministically guess where the split occurs and then check that the first part of the word is in $A$ and the second part is also in $A$. In this situation, there's no need to remember the first part and then match it to the second.

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