****** 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. 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 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...
List 5 strings that belong to the language defined by this regular expression: 0*1(0*1*)*
1. Use a Regular Expression to define the set of all bit strings of one or more 0's followed by only a 1. 2. Use a Regular Expression to define the set of all bit string of two or more symbols followed by three or more 0's. 3. Are these two grammars the same? a. S-> aSb|ab|λ b. S-> aAb|ab A->aAb|λ 4. Use the process of elimination to find the language of the following FA: (see picture for diagram) 5....
Find all strings with length exactly 4 represented by the regular expression, a*bb*. Put your answers in alphabetical order separated by a single space and no commas.
Write down the regular expressions for the following set of strings over {a, b}: 1.Strings that contain no more than one occurrence of the string aa. 2.All strings containing aba: 3.All strings of odd length 4.A string in this language must have at least two a's. 5.All strings that begin with a, and have an even number of b Bonus - All strings with “a” at every odd position