Basic compiler question: Construct a regular expression for the regular language representing the set of strings...
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.
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.
Provide a regular expression for the set of strings over {a, b, c} such that the number of a’s equals the number of b’s and is less than or equal to 2.
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).
Design a regular language where every sentence has to start with any number of strings 101 (any number is none or more), then repeats 00 any number of times, then repeats 01 at least once. Use regular expression notation. Clarification: alphabet is {0,1}. 'string' is the same as program, but here the programs are written using binary alphabet in a silly 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...
Find a regular expression for the following language over the alphabet Σ = {a,b}. L = {strings that begin and end with a and contain bb}.
Please explain the answer shortly! :)
The language of the regular expression (0+10)* is the set of all strings of O's and 1's such that every 1 is immediately followed by a 0. Describe the complement of this language (with respect to the alphabet {0,1}) and identify in the list below the regular expression whose language is the complement of L((0+10)*). (0+1)*11(0+1)* (1+01)* (0+11)* (0+1)*1(8+1(0+1)*)
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...
Automata Theory Construct a regular expression for the set of bit strings in which every odd bit is 1. For example, these are in the language: 10 (OK: 1 in position 1) 111 (OK: 1 in positions 1 and 3) 10101 (OK: 1 in positions 1, 3, and 5) 101111 (OK: 1 in positions 1, 3, and 5) ϵ (OK: There are no odd positions) And these are not in the language: 0111 (BAD: position 1 is not a 1)...