Q:

DFA - Equivalence classes

I am preparing for my exam in formal languages and I need some help with one question from one old exam.

I know that the number of equivalence classes of some regular language L, is the number of states of the minimal DFA for that language.
But how do I give a DFA for one of the equivalence classes ? 
Thanks in advance

A:

An elaborate hint: recall that the proof of the Myhill-Nerode theorem works (in one direction) by constructing a DFA for a language, given its equivalence classes.
In the constructed DFA (i.e the minimal DFA), each state corresponds to an equivalence class. We then set the accepting states to be those that correspond to equivalence classes that are contained in the language.
Now, suppose you create the DFA for the equivalence classes of $L$, without knowing in advance which equivalence classes are in L, and which aren't. If you choose one particular class, and set the state that corresponds to it to be accepting, then the language of the DFA is exactly that equivalence class, which is what you wanted. 
Indeed, the property of the minimal DFA is that for every two words $w,w'$, the runs of the DFA on $w$ and on $w'$ end in the same state iff $w\equiv_L w'$.
Observe that you may end up with a DFA that is not minimal for the equivalence class.

A:

The first thing you have to do is to minimize the given DFA -- or verify that it is already minimal, it happens sometimes. I am sure you have seen this algorithm in your course.
This first step will give you the minimal automaton of L, which as Shaull reminded you, can be formally defined as follows. Denote by $[u]$ the $\equiv_L$-class of a word $u$. Then the minimal automaton of $L$ is $\mathcal{A}_L = (Q, \Sigma, \cdot, [\varepsilon], F)$ where $Q = \{\ [u] \mid u \in \Sigma^*\ \}$, $F = \{\ [u] \mid u \in L\ \}$ and for each letter $a \in \Sigma$, $[u] \cdot a = [ua]$.
Now a hint for your question. What is the language accepted by $\mathcal{A}_u = (Q, \Sigma, \cdot, [\varepsilon], \{[u]\})$, obtained from $\mathcal{A}_L$ by taking only $[u]$ as final state?

