Need clarification on the way a set former is written

272 Views Asked by At

I'm being asked to draw a DFA for the language specified by the following set former:

$$\{xabay\, |\, x \in \{a,b\}^*\text{ and }y \in \{a,b\}^*\}$$

Is this any different than the language specified by the set former:

$$\{xabax\, |\, x \in \{a,b\}^*\}$$

They seem equivalent to me, and I just want to make sure I'm not missing some crucial detail related to set former notation.

2

There are 2 best solutions below

5
On BEST ANSWER

In the first set former, we can have $x=a$ and $y=b$ whereas in the second one you are restricted to the first and last (group of) letters being the same.

I believe an equivalent statement would be

$$\{xabay\,|\,x,y\in\{a,b\}^*\}$$

however don't quote me on that as my set notation is a bit sketchy and there's probably a small detail that I've forgotten about

0
On

Setting $A = \{a,b\}$, the first language can be represented by the regular expression $A^*abaA^*$. Thus it is the set of words having $aba$ as a factor and it is a regular language.

A word $u$ of the second language is also required to have $aba$ as a factor, but a stronger restriction is imposed: one should have $u = pabas$, where the prefix $p$ and the suffix $s$ are equal. This condition makes the second language not regular. Indeed, its intersection with the regular language $a^*abaa^*$ is equal to $\{a^nba^n \mid n > 0\}$ and I let you verify that this language is not regular.