Write a regular expression to describe each of the following languages:
{w Î {a, b}* : every a in w is immediately preceded and followed by b}.
{w Î {a, b}* : w has bba as a substring}.
`Hey,
Note: If you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
a)
(b ∪ bab)*
b)
(a ∪ b)* bba (a ∪ b)*
Kindly revert for any queries
Thanks.
Write a regular expression to describe each of the following languages: {w Î {a, b}* :...
given ∑ = {a,b}: 1. describe in English the languages denoted by the regular expression: (a+b)*b(a+b)* 2. Write a regular expression: L(w) = {w | w has exactly a single substring abaa or exactly a single substring babb} 3. Write a regular expression for the following language: L(w) = {w | w ends in bb and does contain the substring aba}
3) Construct a regular expression defining each of the following languages over the alphabet {a, b}. (a) L = {aab, ba, bb, baab}; (b) The language of all strings containing exactly two b's. (c) The language of all strings containing at least one a and at least one b. (d) The language of all strings that do not end with ba. (e) The language of all strings that do not containing the substring bb. (f) The language of all 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...
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)...
Give a regular expression generating the following languages over the alphabet {a,b}: {w | w is any string except aa and bbb}
1. Write DFA, NFA (small), regular expression and right linear grammar for strings over {a,b} a. End in either aa or bb b. ( an | bna) n >= 0 c. {w : w such that w contains the substring “bb” or w contains an odd number of a’s (or both). d. {w : w does not contain exactly two a’s} e. { w : w starts with substring abb and contains substring bba}
Give a regular expression for each of the following languages. e. {axb | x∈{a, b}*} f. {(ab)n } g. {x ∈ {a, b}* | x contains at least three consecutive as} h. {x ∈ {a, b}* | the substring bab occurs somewhere in x} i. {x ∈ {a, b}* | x starts with at least three consecutive as}
L = {w|w contains the substring bab} give the regular expression that describes L are the 2 languages L and L* the same language? Is L(aba)* a regular language?
Give the regular expressions of the following languages (alphabet is ab): a. {w | w has a length of at least three and its second symbol is a b} b. {w | w begins with an a and ends with a b} c. {w | w contains a single b} d. {w | w contains at least three a's} e. {w | w contains the substring baba} d. {w | w is a string of even length} e. The empty...
3. These languages are not regular. For each, list three strings that would work in a Pumping Lemma proof. Then, use one of them to show the language is not regular. But not a. a. L = {ww | w Î {a, b}*} b. L = {anba2n | n >= 0} c. {w Î S* | w contains more a’s than b’s}.