4. Assume \(\Sigma = \{a, b, c\}\), give string expression: a) All strings containing no more than three a's: b) \(w \in \Sigma^*: w\) has exactly one c c) \(w \in \Sigma^*: w\) contains $sa$ or $bb$ or $cc$
Added by Heather P.
Close
Step 1
Step 1: To generate all strings containing no more than three a's, we can use the regular expression (a|[^a])*a?(a|[^a])*a?(a|[^a])*a?(a|[^a])*. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 81 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
P14.10.3 Find a regular expression for the language of strings in {a, b}* whose number of a's and number of b's are both divisible by 3. (Hint: Build a DFA and use state elimination. This gets a bit messy.)
Akash M.
23. Additional problem 3-19: Find a regular expression to describe the set of all strings over the alphabet {a, b, c} that always contain the substring "bc" (at least one or more times). So, for example, the following strings are in this language: bc, abc, aaaaaaaaabc, abcba, bc, bcb, aaaabcaaacbc, bbc, bcabc. The following strings are NOT in this language: cb, acb, aaaa, bbbb, c, b, a, bronco, cccccccccccccabac. 24. Additional 3-20: Find a regular expression to describe the set of all strings over the alphabet {a, b, c, d} that contain exactly one a and exactly one b. So, for example, the following strings are in this language: ab, ba, cccbad, acbd, cabddddd, ddbdddacccc. The following strings are NOT in this language: a, ccbc, acbcaaacba, acacac, bcbbbbbca, aca, c, d, b.
Madhur L.
write regular expressions for: Strings no more than two 0s. Strings length divisible by 3.
Shaiju T.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD