Regular expression-language

74 Views Asked by At

I want to draw the DFA of the language that is given of the following expression, but I got stuck... Let the expression be {$(xy)^{*},(zx)^{+}$}$xz$ . Could you help me understanding which language it is?

1

There are 1 best solutions below

17
On BEST ANSWER

Let $L$ be the language. Every word of $L$ is

$$\underbrace{xyxyxy\ldots xy}_{n\text{ pairs }xy}\underbrace{zxzxzx\ldots zx}_{m\text{ pairs }zx}xz$$

for some $n\ge 0$ and $m\ge 1$. That is, it must be $0$ or more copies of $xy$, followed by one or more copies of $zx$, followed by a single $xz$. The shortest possible word in $L$ is $zxxz$, with $n=0$ and $m=1$. The next-shortest are $zxzxxz$, with $n=0$ and $m=2$, and $xyzxxz$, with $n=m=1$.

If you’ve already learned about regular grammars, the following may be helpful in getting a handle on $L$. A regular grammar with the following productions generates $L$; $S$ is the initial symbol.

$$\begin{align*} &S\to xyS\mid Z\\ &Z\to zxZ\mid zxxz \end{align*}$$

Every derivation from this grammar begins by applying the production $X\to xyS$ $n$ times for some $n\ge 0$, followed by the production $S\to Z$; at that point we’ve generated the string $(xy)^nZ$. Then the production $Z\to zxZ$ is applied $k$ times for some $k\ge 0$, and the derivation must conclude with an application of $Z\to zxxz$ to get rid of the non-terminal symbol. At that point we have $(xy)^n(zx)^kzxxz$ for some $n,k\ge 0$; if we set $m=k+1$, we can write the same string as $(xy)^n(zx)^mxz$, where $n\ge 0$ and $m\ge 1$.