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

a) Let the alphabet 2 0,1). Write a regular expression for each of the following

ID: 3740832 • Letter: A

Question

a) Let the alphabet 2 0,1). Write a regular expression for each of the following. In this question, you may not use the extended notation (only union, concatenation, and Kleene star) i. Bit strings that have an even number of O's. All words in which '1' appears tripled (and only tripled, meaning all 1's must appear in groups of three). The empty string is also accepted. Please note that blocks of four 1's should not be accepted here All bit strings that do not have substring '01' v All bit strings that contain exactly two 0's or exactly three O's. Write down all strings that are matched by the following regular expression (If there are infinitely many clearly a pattern - .e. a, aa, aaa,.: b) (very)+(chubby )?(short ugly) (wo)?man c) Write a formal grammar for the alphabet 2 a,b,cthat accepts the language of strings that is read the same forward and backwards (i.e. 'abcba' is in the language but 'bcab is not )

Explanation / Answer

Solution:

The first four subparts of the first question have been answered as per Chegg guidelines, please repost others.

a)

i)

The regular expression for this will be

(1*01*01*)*

to get the even number of 0's we have made sure that there are 2 0's generated in every pump of any string which is generated by the above regular expression.

ii)

(0*1110+111)* + (0+111 + 0)*, where + means one or more occurrences of the string

iii)

1*0*

iv)

1*01*01* + 1*01*01*01*

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)