Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Show each of these languages is regular by designing a regular expression for ea

ID: 3820646 • Letter: S

Question

Show each of these languages is regular by designing a regular expression for each language. All languages are over the alphabet sigma = {0, 1}. a) L_1 = {w elementof sigma* | w ends with 1} b) L_2 = {w elementof sigma*| w starts and ends with the same symbol} c) L3 = {w elementof sigma* | w contains at least five 15) d) L_4 = {w elementof sigma*| w contains at most four 0s} e) L_5 = {w elementof sigma* |the length of w is odd} f) L_6 = {w elementof sigma* | the number of 1s in w is not divisible by 3} g) L_7 = {w elementof sigma*|w ends with the substring 110 or 11} h) L_8 = {w elementof sigma* | w contains the substring 1001} i) L_9 = {w elementof sigma* | every third symbol in w is a 1} j) L_10 = {w elementof sigma* | every block of consecutive 0s in w is even in length}

Explanation / Answer

a)

r= (0+1)* 1

explanation:- everystring is generated by (0+1)* after that we concat 1 so all string end with 1

----------------------------------------------------------

b)

start and end with same symbol

r= 0 (0+1)*  0 + 1 (0+1)* 1

------------------------------------------------------------------

c) atleast five 1

r= (0+1)* 1  (0+1)* 1  (0+1)* 1  (0+1)* 1  (0+1)* 1  (0+1)*

-----------------------------------------------------------------------------------

d)

r= 1* + 1*0 1* + 1*0 1* 0 1* + 1*0 1* 0 1* 0 1* + 1*0 1* 0 1* 0 1* 0 1* + 1*0 1* 0 1* 0 1* 0 1* 0 1*