# DFA Minimization: Finding all equivalence classes of $\mathsf{R_L}$ for language $011(0+1)^*011$

How do we find all equivalence classes of $\mathsf{R_L}$ for a language?

Say I'm trying to look for all equivalent classes for the regular language $\mathsf{L}$ is $011(0+1)^*011$.

ps The relation $\mathsf{R_L}$ is an equivalent relation. $\mathsf{R_L}$ on $\Sigma^* as:$ $xRy$ iff $(\forall w)[xw \in \mathsf{L} \Leftrightarrow yw \in \mathsf{L}]$

-
What is $R_L$? Can you elaborate a little more? –  Dave Clarke Feb 22 '13 at 20:06
Equivalent Relation (also added to question) en.wikipedia.org/wiki/Equivalence_relation –  echad Feb 22 '13 at 20:16
Please change the question, rather than just answering in comments. –  Dave Clarke Feb 22 '13 at 20:42
If you take a minimal DFA of some language and try all the possible ways of applying Arden's lemma, you will find a finite number of equivalent regular expressions for that language. That could serve as an algorithm.. and there are finitely many. –  saadtaame Feb 22 '13 at 20:59
@saadtaame : First, it's a nice solution! As for your example - for a finite language of course there are only finitely many regexes. But for an infinite language there are infinitely many. –  Shaull Feb 22 '13 at 21:04

## 1 Answer

You may want to look at Sipser's "Theory of Computation" for a full explanation. Technically, you must first define the problem. What do you mean by "find the equivalence classes"? You probably mean that you want to find a representative of each class, or to find an algorithm that given a word, classifies it to a class.

Probably the easiest way to do so, is to construct a DFA for the language, and then minimize it. By the correctness proof of minimization, the states of the minimal DFA correspond to the equivalence classes.

EDIT: The example in the book doesn't show you how to find the equivalence classes algorithmically. It just shows an example of finding them based on intuition and clever thinking (as you would do with a general mathematical problem). There is no general way to do that.

What the example demonstrates is that if you find these classes, then you can construct a minimal DFA. The interesting point is that the converse is also true.

-
Looked at Sipser's but it wasn't as helpful... Were actually using Ding-Zhu Du'sTheory of Computational Complexity –  echad Feb 22 '13 at 20:21
None the less, the answer is still valid. You can construct an NFA from the regular expression, determinize it using the subset-construction, and then minimize it using your favorite minimization algorithm (there are several). –  Shaull Feb 22 '13 at 20:25
I think you were right about constructing a DFA, that' might've been the step I was missing in the analysis –  echad Feb 22 '13 at 21:09