building a DFA from equivalence classes of $R_L$(tricky)

142 Views Asked by At

I've encoutered an interesting question from an old exam with no solution and I was wondering: how do you build a dfa (deterministic finite automata) from given equivalence classes?

this is the question:

L is a language over {0,1}, for which the equivalence classes of $R_L$ are:

$\left\{w|\#\:_0\left(w\right)\text{ is even and }\#_1\:\left(w\right)\text{ is even}\right\}$

$\left\{w|\#\:_0\left(w\right)\text{ is even and }\#_1\:\left(w\right)\text{ is odd}\right\}$

$\left\{w|\#\:_0\left(w\right)\text{ is odd and }\#_1\:\left(w\right)\text{ is odd}\right\}$

$\left\{w|\#\:_0\left(w\right)\text{ is odd and }\#_1\:\left(w\right)\text{ is even}\right\}$

also: $\epsilon \in L$ and $0, 1, 1110 \not \in L$.

How can I build a deterministic finite automata that accepts L?

I would really appreciate an elaborated answer so I could actually understand what you've done and learn from it.

EDIT: what I tried. Basically from what i understood, because the language consists only of {0,1}, then we can divide it into equivalence classes such that whether $\#_0$ and $\#_1$ are even or odd. However, I don't know how to create the DFA from the equivalence classes. This is why I've been asking for help because I don't understand how to do it. Since $\epsilon \in L$ then I can connect it somehow in the digraph. Basically it is represting all of the possible number of occurences of {0,1} excluding 0, 1, 1110.

Sorry if I couldn't write more, I just don't know how to do it.

1

There are 1 best solutions below

0
On

Step 1: what are the states? Following Myhill-Nerode, they're the equivalence classes.

Step 2: what are the transitions? For each of the four equivalence classes, and each of the two symbols in the alphabet, what equivalence class do we move to if we append that symbol?

Step 3: what is the initial state? Does $\epsilon$ have an even or odd number of zeros and ones?

Step 4: what are the accepting states? This is where you use the information that $\epsilon \in L$ and $0,1,1110 \not\in L$. (It's not a coincidence that the number of words given there is equal to the number of equivalence classes).