Demonstrate if a language is regular

68 Views Asked by At

The problem is to demonstrate the regularity of the following language: {xy ∈ {a,b}* | |X|a = 2|Y|b} which refers to words of the form xy where the number of occurrences of a in subword x is twice the number of occurrences of b in subword y. I suspect that it is regular but I don't know how to demonstrate it. Finding its DFA would be enough ?

Thanks in advance

1

There are 1 best solutions below

2
On

The set of regular languages is closed under intersection. So suppose your language $L$ is regular. Then $L \cap a^{*}b^{*} = \{ a^{n}b^{2n} : n \in \mathbb{N} \}$ is also regular. A pumping lemma argument easily shows that $L^{\prime} = \{ a^{n}b^{2n} : n \in \mathbb{N}\}$ is not regular.

Pump the string $a^{p}b^{2p} \in L^{\prime}$, where $p$ is the pumping length of $L^{\prime}$.

As $L^{\prime}$ is not regular and $a^{*}b^{*}$ is regular, it follows that $L$ is not regular.