(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 the alphabet Σ = {a, b} for both parts. i. ((ab) ∗a) + b ∗ ii. baa + b
(a) Give 2 strings that are members of language specified by the regular expression (0+ 1)∗...
For each of the following regular expressions, give two strings that are members and two strings that are not members of the language described by the expression. The alphabet is ∑ = {a, b}. a(ba)∗b.(a ∪ b)∗a(a ∪ b)∗b(a ∪ b)∗a(a ∪ b)∗. (a ∪ ba ∪ bb)(a ∪ b)∗.
4. A regular expression for the language over the alphabet fa, b) with each string having an even number of a's is (b*ab*ab*)*b*. Use this result to find regular expressions for the following languages a language over the same alphabet but with each string having odd number of a's. (3 points) a. b. a language over the same alphabet but with each string having 4n (n >- 0) a's. (3 points)
Give a regular expression that generates C In certain programming languages, comments appear between delimiters such as /# and #. Let C be the language of all valid delimited comment strings. A mem- ber of C must begin with /# and end with #/ but have no intervening #. For simplicity, assume that the alphabet for Cis Σ {a, b, /
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 start with 00 or end with 101 (or both). Syntax The union is expressed as R|R, star as R*, plus as R+, concatenation as RR. Epsilon is not supported but you can write R? for the regex (R|epsilon).
Find a regular expression for the following language over the alphabet Σ = {a,b}. L = {strings that begin and end with a and contain bb}.
************Theory of Computing ***************** 1. Generate a regular expression of “all words over the alphabet Σ = {a b} that either begin with a and end with b OR begin with b and end in a.” Thus, the first few shortest words in this language are “ab” “ba” “aab” “baa” “abb” “bba” “aaab” etc. So, if a word begins with a it must in end b, and if it begins with b it must end in a. 2. Consider the...
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....
Describe, as precisely as possible, the language generated by each of the following regular expressions. The alphabet is {a, b} (1) (aaa)* b(bb)* (2) abab(ab)* (3) b (e U a) b (4) a(aa) (bb)* UE*baa
1(a)Draw the state diagram for a DFA for accepting the following language over alphabet {0,1}: {w | the length of w is at least 2 and has the same symbol in its 2nd and last positions} (b)Draw the state diagram for an NFA for accepting the following language over alphabet {0,1} (Use as few states as possible): {w | w is of the form 1*(01 ∪ 10*)*} (c)If A is a language with alphabet Σ, the complement of A is...
Give English descriptions of the languages represented by the following regular expressions. The descriptions should be simple, similar to how we have been defining languages in class(e.g., “languages of binary strings containing 0 in even positions. . .”). Note: While describing your language, you don’t want to simply spell out the conditions in your regular expressions. E.g., if the regular expression is 0(0 + 1)∗, an answer of the sort “language of all binary strings that start with a 0”...