The Gateway to Computer Science Excellence
0 votes
73 views

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

in Theory of Computation by Active (2.8k points) | 73 views
0
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 (651 points)
edited by
0
your regular expression is not accepting epsilon but according to language epsilon is also part of it.
0
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,647 questions
56,459 answers
195,378 comments
100,273 users