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.
answer)
given alphabet is {0,1}
set of all bit strings with two symbols is constructed by (0+1)(0+1)=00+01+10+11
set of all bit strings with three symbols is constructed by (0+1)(0+1)(0+1)=000+001+010+011+100+101+110+111
regular expression for set of all bit string that contain two or three symbols is union of above two regular expressions.
i.e (0+1)(0+1)+(0+1)(0+1)(0+1)
Construct a regular expression that recognizes the following language of strings over the alphabet {0 1}:...
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).
Construct an DFA automaton that recognizes the following language of strings over the alphabet {a,b}: the set of all strings over alphabet {a,b} that contain aa, but do not contain aba.
Find a regular expression for the following language over the alphabet Σ = {a,b}. L = {strings that begin and end with a and contain bb}.
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...
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}
Construct regular expressions for the following languages over the alphabet {a, b}: a. Strings that do not begin with an “a”. b. Strings that contain both aa and bb as substrings.
Suppose alphabet Σ = {a} and consider the following regular language A, A = {w | |w| ≥ 4}, i.e., strings whose length is at least 4 (equivalently, unary numbers x ≥ 4). a) Construct a DFA that recognizes A with as few states as possible (draw a state diagram). b) Construct a PDA that recognizes A with as few states as possible (draw a state diagram). Note that the stack alphabet may include additional symbols.
1. Construct a Finite Automata over Σ={0,1} that recognizes the language {w | w ∈ {0,1}* contains a number of 0s divisible by four and exactly three 1s} 2. Construct a Finite Automata that recognizes telephone numbers from strings in the alphabet Σ={1,2,3,4,5,6,7,8,9, ,-,(,),*,#,}. Allow the 1 and area code prefixing a phone number to be optional. Allow for the segments of a number to be separated by spaces (denote with a _ character), no separation, or – symbols.
4(10 points] Let A be the language over the alphabet -(a, b) defined by regular expression (ab Ub)aUb. Give an NFA that recognizes A. Draw an NFA for A here 5.10 points] Convert the following NFA to equivalent DFA a, b
4(10 points] Let A be the language over the alphabet -(a, b) defined by regular expression (ab Ub)aUb. Give an NFA that recognizes A. Draw an NFA for A here 5.10 points] Convert the following NFA to equivalent DFA...
(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...