Show that the following language over the alphabet Σ = {0,1} is regular:
D = {w | w contains an equal number of occurrences of the substrings 01 and 10}
Note that 1011001 in D because it contains two occurrences each of 01 and 10 as substrings.
On the other hand, 10110 in D because 10110 contains two occurrences of 10 and one occurrence of 01. (8 points)
Note that the regularity of D contrasts with the nonregularity shown in the textbook and class of the language
C = {w | w contains an equal number of 0's and 1's}
2. Show that the following language over the alphabet Σ = {0,1} is regular:
D = {w | w contains an equal number of occurrences of the substrings 01 and 10}
Note that 1011001 ∈ D because it contains two occurrences each of 01 and 10 as substrings. On the other hand, 10110 ∉ D because 10110 contains two occurrences of 10 and one occurrence of 01. 8 points
Note that the regularity of D contrasts with the nonregularity shown in the textbook and class of the language
C = {w | w contains an equal number of 0's and 1's}