Regular Languages
[46/52%]How many strings over the alphabet are there which are of length , where is a nonnegative integer?
For strings and .
Solve the word equation
over the alphabet ; that is, find the set of strings over which satisfy the equation.
Let and . Find then .
Is it true that if is of size and is of size then must be of size ?
Let and . Find , .
The language is the set of all binary strings having no substring 11 and ending with 0.
Show that for any languages and ,
if and only if .
For languages and and .
(Arden's Lemma). Assume that are two languages with , and is a language satisfying the relation . Then, .
Assume that languages satisfy the following two equations:
Find simple representations for and .
Let and . What are and ?
Let be a language over and . Find necessary and sufficient conditions in terms of and for the equation
For each of the following equations, determine whether it is true for all languages or not. Present a proof or a counterexample.
.
.
.
.
.
Show that, for .
Show that, for .
Assume that . Show that, for .
Prove the following identities on languages :
.
.
.
.
.
Find the shortest string over alphabet which is not in
Find the general solutions for the equation
for .
Solve the following language equations for languages :
Is the set a regular language?
Is the set a regular language over the binary alphabet?
.
.
Find a regular expression for the set of binary expansions of integers which are the powers of 4.
Find a regular expression for the set of binary strings which have at least one occurrence of the substring 001.
Find a regular expression for the set of binary strings which have no substring 001.
Find a regular expression for the set of all binary strings with at most one pair of consecutive 0's and at most one pair of consecutive 1's.
Find a regular expression for the set of all binary strings with the property that none of its prefixes has two more 0 's than 1 's nor two more 1's than 0 's.
Find a regular expression for the set of all nonempty strings having no repeated adjacent symbols over the arabic digits.
Find a regular expression for the set of all strings over alphabet
that represent correct additions over binary expansions of integers, with leading 0 's added when necessary. For example, the relation
implies that the string
is in the set.
For each language over alphabet , let be the set of all suffixes of strings in , that is, . Show that if is a regular language so is .
Show that every regular language has a regular expression in disjunctive normal form , in which each , for , does not contain the operator + .
Describe in English the languages expressed by the following regular expressions:
.
.
.
.
Simplify the following regular expressions:
.
.
.
Construct regular expressions for the following languages over alphabet :
The set of all strings whose fifth symbol from right is 0.
The set of all strings having either 000 or 111 as a substring.
The set of all strings having neither 000 nor 111 as a substring.
The set of all strings having no substring 010.
The set of all strings having an odd number of 0 's.
The set of all strings having an even number of occurrences of substring 011. [Hint: First find the regular expression for the set of binary strings having no substring 011.]
Show that .
Construct a regular expression for the set of all strings over alphabet
that represent correct subtractions. For example,
implies that string
is in the set.
Show that for any regular language and are regular.
Show that if is a regular language, then is regular.
Suppose is a mapping satisfying for any . Show that if is a regular set over , then is a regular set over . Conversely, if is a regular set over , then is a regular set over .
Construct for .
Construct for .
What is the shortest string in each of the following languages? What is the shortest nonempty string in each language?
.
.
.
Find an algorithm to find a shortest string in a regular set with a given regular expression.
Find an algorithm to find a shortest string in a regular set with a given graph representation of a regular expression.
Find labeled digraph representations for the following regular expressions:
.
.
.
Determine the regular expressions represented by digraphs in Figure 1.7.
Figure 1.7: Three digraphs for Exercise 4.
Find the simplest digraph representing .
Find counterexamples to show that Theorem 1.25 is incorrect if we remove the requirements that must be a nonfinal vertex and must be a noninitial vertex.
Theorem 1.25: Let be a regular expression. Then, an -edge in which is a unique out-edge from a nonfinal vertex or a unique in-edge to a noninitial vertex can be shrunk into a single vertex, still preserving the property of Theorem 1.23. (If one of the endpoints of the -edge is the initial vertex or the final vertex, then so is the resulting vertex.)