# Identifying the Equivalence Classes of a Language with equal number of 10 and 01 strings

I'm doing a problem where I need to find the equivalence classes of the language below:

Let A = {x ∈ {0, 1}* | #(01, x) = #(10, x)}, where, for a, b ∈ {0, 1}*, #(ab, x) is the number of places in x where an a is immediately followed by a b.

So I can start to see some equivalence classes. 1* and 0* both are in A, because they both have zero 10's and 01's, so the condition holds. I don't really know how I would describe the other equivalence classes?

Any help would be great!

• Construct a minimal DFA for your language. The equivalence classes are the languages of the states. Feb 22 '19 at 3:33
• Hint: $A$ consists of words whose initial and final letters coincide (plus $\epsilon$). Feb 22 '19 at 5:00