Question
EXERCISES. (SET 2). 2. Let A={a, b, c}. Find a regular expression r such that L(r) consists of all words w where: 2.1. Each word
EXERCISES. (SET 2). 2. Let A={a, b, c}. Find a regular expression r such that L(r) consists of all words w where:
2.1. Each word w from L(r) contains the subword abb or aac.
2.2. Each word w from L(r) has a length l(w)>=3 and do not start with the letter c.
2.3. Each word w from L(r) has a length l(w)>=2 and the second letter is always b.
2.4. If c from w then c is preceded by an a.
2.5. If c from w then acb from w. Equivalent description: the letter c can appear in a word w only as part of the subword acb of the word w.
2.6. Each word contains no more than two letters c.
2.7. Given a word w from L(r), if b belongs w then cb belongs w. Equivalent description: the letter c cannot be a predecessor of the letter b in any word w.
2.8. There is no w from L(r) with two or more consecutive a's.
2.9. If w from L(r) then neither ba nor bb is a subword of w.
2.10. Given a word w from L(r), if a from w then abc from w. Equivalent description: the letter a can appear in a word w only as part of the subword abc of the word w.
2.11. Each word w from L(r) has a length l(w)>=2 and the letter before last one is exactly c.
2.12. If w from L(r) then w does not contain the sequence ab as a subword.
2.13. Let w from L(r) and w=x1x2xn. If xk=c then there exists an index m
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started