# Regular language

82 views

#I am confused in the language (iv) . Someone please explain.

0
4th is regular... it will be like 0(0+1)*0 + 1(0+1)*1 + 0 + 1 +  epsilon

1 vote

it is regular language

as language consists of equal number of 10 and 01

Now, suppose in the string you have 01 , now we need another 10 to make count same

this can be thought of as whenever you see a 01 at some point next character should be sequence of 0 or a single 0. in that case string formed is of the type 010*0. therefore, the count of 01 and 10 remains the same. But if you  have 011 type sub string then you need to see another 0 for example 011*0 is also a valid string.

so the regular expression is 1(1+00*1)*+0(0+11*0)* + epsilon

edited
0
your regular expression is not accepting epsilon but according to language epsilon is also part of it.
0
mistake accepted...:)

## Related questions

1
204 views
Given L = { 0*1 + 0 + 1* + 10*1} where + symbol is UNION and NOT positive closure. Please draw the Minimal DFA for this.
Consider the following language: L = {w| w $\epsilon$ {0,1}* ; w has equal number of occurances of 001' and 010' } The solution they provided: The absolute difference between the number of occurrences of 001' and 010' is at most 1. Hence a DFA can be found. I ... going to find an occurrence of 010' (and vice-versa)). But, since such info is not given, so how this can be a regular language?