1)
a)bac+bc
this regular expression accepts strings bac or bc
Language is {bac,bc}
b)b*ac+bc*
Language is {ac,,bac,bbac,,bbbac,.......,b,bc,bcc,bccc,,........}
this regular expression accepts set of strings starts with any number of b's and ends with ac or start with single 'b' and ends with any number of c's.
c)b*ccca*
Language is {ccc,bccc,ccca,bbccc,bbccca,bbcccaa,..............}
this regular expression accepts set of strings starts with any number of b's followed by three c's followed by any number of a's.
2)answer)
the language i s{b,ac,bac,bc,.....,b^n ac,bc^n,.......}
regular expression is b*ac+bc*
1. For each of the following regular expressions find a language (i.e., a set of strings)...
1. Write regular expressions to capture the following regular languages: (a) The set of binary strings which have a 1 in every even position. (Note: odd positions may be either 0 or 1.) (b) The set of binary strings that do not contain 011 as a substring. (c) Comments in Pascal. These are delimited by (* and *) or by { and }, and can contain anything in between; they are NOT allowed to nest, however. 2. Write a DFA...
Write down the regular expressions for the following set of strings over {a, b}: 1.Strings that contain no more than one occurrence of the string aa. 2.All strings containing aba: 3.All strings of odd length 4.A string in this language must have at least two a's. 5.All strings that begin with a, and have an even number of b Bonus - All strings with “a” at every odd position
Give regular expressions for the following languages: (a) The language of all strings over {a,b} except the empty string. (b) The language of all strings over {a,b} that contain both bab and bba as substrings. (c)L k = {w ∈ {a,b} * | w contains a substring having 3 more b’s than a’s}. (d) The language of all strings over {a,b} that have a b in every odd position (first symbol is considered position 1; empty string should be accepted)...
Basic compiler question: Construct a regular expression for the regular language representing the set of strings where the number of b’s is a multiple of 3 and there can be any number of a’s. The alphabet is {a,b}
Regular expressions, DFA, NFA, grammars, languages
Regular Languages 4 4 1. Write English descriptions for the languages generated by the following regular expressions: (a) (01... 9|A|B|C|D|E|F)+(2X) (b) (ab)*(a|ble) 2. Write regular expressions for each of the following. (a) All strings of lowercase letters that begin and end in a. (b) All strings of digits that contain no leading zeros. (c) All strings of digits that represent even numbers. (d) Strings over the alphabet {a,b,c} with an even number of a's....
Exercise 3.1.1: Write regular expressions for the following languages: * a) The set of strings over alphabet {a,b,c} containing at least one a and at least one b. b) The set of strings of O's and l’s whose tenth symbol from the right end is
Construct a regular expression that recognizes the following language of strings over the alphabet {0 1}: The language consisting of the set of all bit strings that contain two or three symbols.
(a) Give 2 strings that are members of language specified by the regular expression (0+ 1)∗ but are not members of the language specified by 0∗ + 1∗ . Then give 2 strings that are members of both languages. Assume the alphabet is Σ = {0, 1}. (b) For each of the following languages specified by regular expressions, give 2 strings that are members and 2 strings that are not members (a total of 4 strings for each part). Assume...
Find a regular expression for the following language over the alphabet Σ = {a,b}. L = {strings that begin and end with a and contain bb}.
For each of the following pairs of regular expressions and strings, indicate the reason that the string does not match the regular expression Regular Expression String Reason for mismatch AbCdEfG AbCdefG [A-Z][a-zl*! CamelCase! Abc\.def Abcxdef 4 qwqwqwqX 6.I-11-90-9) [A-Z][A-Zlla-z] Xpp 8 Ovla-ZA-ZO-9]+ Ovalpha-bet3 [aeiou][a-z]*[A-Z]ayrunAway 10. [a-c-((de)l(fg))? m-defg