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

Exercise 1: Theoretical regular expressions Math in Markdown cells: You can inco

ID: 3755069 • Letter: E

Question

Exercise 1: Theoretical regular expressions Math in Markdown cells: You can incorporate mathematics in Markdown code. (It uses the LaTeX syntax, if you're familiar with that.) Mathematics code is enclosed in dollar signs, $···$ . Double click on this cell to see the code for the following RE examples: a, R", (RIS) Assume a, b, c, d ; i e. the first four lowercase Latin letters. Give regular expressions that generate the following sets Follow the following important notes: Use the theoretical REs we learned: i.e., any in RS, R, and (RIS). . Use Markdown's mathematics syntax to do this.. 0. Example: The set of all strings not including d. Answer: (alblc)* 1. The set of all strings ending in b. Answer: (put answer here) 2. The set of all strings in which b is the second to last symbol. Answer: (put answer here) 3. The set of all strings of even length. Answer: (put answer here) 4. The set of all strings that contain neither a ab nor ba sequence. Answer: (put answer here) 5. The set of all strings containing exactly one b. Answer: (put answer here)

Explanation / Answer

Answers
1. (a|b|c|d)*b
2. (a|b|c|d)*b(a|b|c|d)
3. ((a|b|c|d)(a|b|c|d))*
4. a*|b*
5. a*ba*

Explanation
1. 0/more number of abcd can come before last letter b
2. 0/more number of abcd can come before last but one letter b and then any of the abcd can come
3. 2 letters of abcd each time to make it even length
4. Then either a's alone or b's alone are possible
5. Before and after b, 0/more number of ab's can come

---

Hit the thumbs up if you are fine with the answer. Happy Learning!