Give a regular expression for the language of strings over {a,b} in which each substring of length 2 contains two distinct characters
b(ab)*a? + a(ba)*b? Explanation: ------------- if string starts with b, then string can have any number of (ab) strings, then may or may not end with an a. b(ab)*a? if string starts with a, then string can have any number of (ba) strings, then may or may not end with a b. a(ba)*b?
Give a regular expression for the language of strings over {a,b} in which each substring of...
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)...
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...
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?
(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...
Construct a PDA that matches all strings in the language over {a,b,c,d} such that each occurrence of the substring ab is eventually followed by a distinct occurrence of a substring cd (e.g.,abcdabcd and abababadcacdcdcdcd are acceptable, but cdab and ababdddcd are not). Give a short description of the set of strings associated with each state of your PDA.
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}
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.
Find a regular expression for the following language over the alphabet Σ = {a,b}. L = {strings that begin and end with a and contain bb}.
1. Give a regular expression for the set of strings over {a, b, c} such that the sum of the number of a’s and the number of b’s is equal to 3.
(4 points.) Consider the regular expression (11 + 00)'1(e + 01). . Give two strings of O's and 1's, each 6 to 12 characters long, that are both represented by this regular expression . Construct a nondeterministic finite automaton equivalent to the regular expression.
(4 points.) Consider the regular expression (11 + 00)'1(e + 01). . Give two strings of O's and 1's, each 6 to 12 characters long, that are both represented by this regular expression . Construct a...