****** Theory of Computing *********
1. Provide a regular expression for “all even length strings of b’s”.
2. List all words of length 4 in Language((a+b)* a). Also, provide an English description of this language.
1.
If the alphabet Σ = (b) then,
the regular expression for all the even length strings of b is
R = (bb)*.
Here, ε is considered to be of even length.
2.
The regular expression for the language given is (a+b)*a.
To get the list of words of length 4 from the language, the following steps are taken :
List out all the strings of length 4 possible from the alphabet of Σ (a,b). This can be done by treating 0 in a truth table as symbol a and 1 in the truth table as symbol b. So, for strings of length, a combination of 24 = 16 are made as in a truth table.
aaaa
aaab
aaba
aabb
abaa
abab
abba
abbb
baaa
baab
baba
babb
bbaa
bbab
bbba
bbbb
Step 2 :
Extract only those strings that end with symbol a.
So, the strings of length 4 are :
aaaa
aaba
abaa
abba
baaa
baba
bbaa
bbba
The language described by the given regular expression is used to denote the set of all strings that end with symbol a.
****** Theory of Computing ********* 1. Provide a regular expression for “all even length strings of...
*********************************** Theory Of Computing **************************************************** 1. Given the language “all even length strings of b’s” a. Define this language using the listing method. b. Define this language using the mathematical notation method. c. Define this language using the recursive definition. 2. Provide a regular expression for “all even length strings of b’s”. 3. List all words of length 4 in Language((a+b)* a). Also, provide an English description of this language.
************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...
Question 1 - Regular Expressions Find regular expressions that define the following languages: 1. All even-length strings over the alphabet {a,b}. 2. All strings over the alphabet {a,b} with odd numbers of a's. 3. All strings over the alphabet {a,b} with even numbers of b’s. 4. All strings over the alphabet {a,b} that start and end with different symbols. 5. All strings over the alphabet {a, b} that do not contain the substring aab and end with bb.
Provide a regular expression that describes all bit-strings that length is at least one and at most three.
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.
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}
Provide a regular expression for the following languages: (a) the set of all strings over {a, b} that start with ab and end with ba, (b) the set of strings over {a, b} where four consecutive occurrences of both letters occur in every word.
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.
(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...
Create Regular Expression for the following language: Σ = { 0, 1 } All strings that optionally start with 1111 and must end with 0000.