[Math] Myhill Nerode equivalence classes

equivalence-relations

My task is to find equivalence classes for different languages based on Myhill-Nerode. I'm having a hard time finding these equivalence classes; for example, the language $L = {0,1}^*$ with alphabet $\{0,1\}$.

I'd say there is only one class, being $[\epsilon]$ , because no matter if I add $0$ or $1$, the word will always be in language $L$. Or are there three classes, an $[\epsilon]$ class, a $[0]$ class with words starting with a $0$, and a $[1]$ class with words starting with $1$?

Any help would be much appreciated.

Best Answer

Your first idea is correct.

Let $\sim$ be the Myhill-Nerode equivalence relation for the language $\{0,1\}^*$ over the alphabet $\Sigma=\{0,1\}$. Then for $x,y\in\Sigma^*$ we have $x\sim y$ if and only if for each $z\in\Sigma^*$ either $xz\in L$ and $yz\in L$, or $xz\notin L$ and $yz\notin L$. Since $L=\Sigma^*$, it’s clear that for any $x,y,z\in\Sigma^*$ we have $xz\in L$ and $yz\in L$, so $x\sim y$ for all $x,y\in\Sigma^*$, and there is indeed only one $\sim$-equivalence class: $[x]=\Sigma^*$ for each $x\in\Sigma^*$. In particular, $[x]=[\epsilon]$ for all $x\in\Sigma^*$.