Given any alphabet $\Sigma$, the language $L$ over $\Sigma^*$ described by $\{x:$ any symbol of $x$ differs from the previous symbol$\}$ is regular

1.3k Views Asked by At

This was given as a challenge problem during one of my lectures

Given any alphabet $\Sigma$, the language $L$ over $\Sigma^*$ described by $\{x: \text{any symbol of }x\text{ differs from the previous symbol}\}$ is regular.

How do I prove that this is true or false? The way I thought about it was that x could be any "symbol" and therefore the language could contain an infinite number of some "symbols", and since it is infinite it is therefore not regular, is this correct?

2

There are 2 best solutions below

0
On

Can you think about a DFA accepting this language? Hint: there are only finitely many subsets $A$ of the alphabet $\Sigma$, try to use these as states in a machine for the symbols we have already "seen".

0
On

Hint. You probably know that the complement of a regular language is regular. Therefore it suffices to establish that the complement $L^c$ of your language is regular. Now $L^c$ is the set of words containing two equal consecutive letters. Can you find a regular expression for $L^c$?