The Gateway to Computer Science Excellence
0 votes

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

in Theory of Computation by Active (2.8k points) | 73 views
4th is regular... it will be like 0(0+1)*0 + 1(0+1)*1 + 0 + 1 +  epsilon

1 Answer

+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 

by Junior (659 points)
edited by
your regular expression is not accepting epsilon but according to language epsilon is also part of it.
mistake accepted...:)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,374 answers
105,287 users