Write a regular expression for each of the following languages: (a) Given an alp
ID: 2246781 • Letter: W
Question
Write a regular expression for each of the following languages:
(a) Given an alphabet = {0, 1}, L is the set of all strings of alternating pairs of 0s and pairs of 1s.
(b) Given an alphabet = {0, 1}, L is the set of all strings of 0s and 1s that contain an even number of 0s or an even number of 1s.
(c) Given an alphabet = {a, b, c, d}, L is the set of all strings in which the letters appear in strictly ascending lexicographical order. Strictly ascending means that the same letter can’t appear twice.
Explanation / Answer
a
(0011)*(00)? | (1100)*(11)?
b
(((10|01)(00|11)*(10|01))|(00|11))*
c
(a?b?c?d?)
OR
(ab?c?d?)(a?bc?d?)(a?b?cd?)(a?b?c?d)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.