Finite Automata
[102/59%]Consider a DFA where , and is the function defined by the following table:
| 0 | 1 | |
|---|---|---|
Draw the transition diagram of .
Consider the DFA given by Figure 2.2 Determine whether accepts strings 000 and 010.
What is the language accepted by the of Figure 2.2?
What is the language accepted by the DFA of Figure 2.3?
What is the language accepted by the of Figure 2.4?
Consider the DFA with the transition diagram of Figure 2.5.
Which state is the initial state of , and which states are the final states of ?
For each of the strings 0001, 010101, and 001110101101, find the computation path of on the string and determine whether accepts it.
Among all strings in (01)*, which ones are in ?
Figure 2.5: DFA of Exercise 1.
For integers , consider a DFA , where , and .
Draw the transition diagram of with and .
Suppose and . Find and .
Suppose and . Find binary strings and such that and .
- Show that for any state , there exists a string such that .
Figure 2.6: Three DFA’s of Exercise 3.
For each of the DFA's and , as shown in Figure 2.6(a), (b) and (c), respectively, describe in English the language accepted by it.
.
The set of all binary strings beginning with prefix 01.
The set of all binary strings having a substring 00.
The set of all binary strings having the substring 00101.
The set of all binary strings ending with 01.
The set of all binary expansions of positive integers which are congruent to zero modulo 5.
The set of all binary strings having a substring 00 or ending with 01.
The set of all binary strings having a substring 00 and ending with 01.
The set of all binary strings having a substring 00 but not ending with 01.
The set of all binary strings in which every block of four consecutive symbols contains a substring 01.
For each of the following languages, construct a DFA that accepts the language:
The set of binary strings beginning with 010.
The set of binary strings ending with 101.
The set of binary strings beginning with 10 and ending with 01.
The set of binary strings having a substring 010 or 101.
The set of binary strings in which the last five symbols contain at most three 0's.
The set of binary strings in which is divisible by 5, where is the number of occurrences of the symbol in string .
The set of strings over the alphabet in which the sum of all symbols is divisible by 5.
The set of strings over the alphabet which are the ternary expansions (base-3 representations) of positive integers which are congruent to 2 modulo 7.
The set of binary strings in which every block of four symbols contains at least two 0's.
The set of binary strings in which every substring 010 is followed immediately by substring 111.
For each of the following languages, use the product automaton method to construct a DFA that accepts the language:
The set of binary strings beginning with 010 or ending with 101.
The set of binary strings having a substring 010 but not having a substring 101.
The set of binary strings beginning with 010, ending with 101 and having a substring 0000.
For each of the following languages, use the checker method to construct a DFA that accepts the language:
The set of Example 2.12.
The set of Example 2.14.
The set of Exercise 2(a) above.
The set of Exercise 2(c) above.
Find an NFA that accepts the set of binary strings having a substring 010.
Find an NFA that accepts the set of binary strings beginning with 010 or ending with 110.
Find an NFA that accepts the set of binary strings with at least two occurrences of substring 01 and ends with 11.
Figure 2.22: The Solution to Example 2.19.
Find an NFA that accepts the set .
Let and be two NFA's. Construct an NFA such that .
Let be an NFA. Construct an NFA such that .
Consider the NFA of Figure 2.26.
What are -closure and -closure ?
What are and ?
Draw the computation trees of on strings and . Does accept or reject and ?
Figure 2.26: The NFA of Exercise 1.
For each NFA shown in Figure 2.27, determine what is.
For each of the following languages, construct an NFA that accepts the language:
The set of binary strings that contain at least three occurrences of substring 010.
The set of binary strings that contain both substrings 010 and 101. [Hint: This is equivalent to the set of binary strings that contain either a substring 0101 or a substring 1010 or a substring 010 followed by 101 or a substring 101 followed by 010.]
The set of binary strings that contain either a substring 010 or a substring 101, and end with 111 or 000.
The set of binary strings of which the th symbol is 0 for each .
The set of binary strings of length for some , such that, for each , at least one of the nd, st and th symbols of is 0.
The set .
Figure 2.27: Three NFA’s of Exercise 2.
Prove that the new initial state and the final state in the construction of Example 2.22 are necessary. That is, find NFA's and such that the NFA's and of Figure 2.28 have the property and .
An NFA is given by , and
| 0 | 1 | ||
|---|---|---|---|
| - | |||
| - | - | ||
| - | - | ||
| - | - | ||
| - | - |
(See Figure 2.29(a) for the transition diagram of .) Find a DFA which is equivalent to the NFA .
Figure 2.29: Converting an NFA to a DFA.
Construct a DFA which is equivalent to the NFA , where
| 0 | 1 | |
|---|---|---|
| - | ||
| - | - |
Let be an given by
| 0 | 1 | |
|---|---|---|
| - |
Construct an NFA that accepts .
Construct a DFA accepting the set of all binary strings in which the fifth symbol from right is 0.
Consider the following multiplication table on :
For any string in , denote by the value obtained by multiplying symbols in from left to right. For instance, let . Then, we get
Construct an NFA for the set of all strings over such that . (E.g., and .)
Convert each of the following NFA's into an equivalent DFA:
The NFA , with
| 0 | 1 | |
|---|---|---|
| - | ||
| - | - |
The NFA of Figure 2.27(a).
The NFA of Figure 2.27(b).
The NFA of Figure 2.27(c).
For each of the following languages, construct a DFA that accepts the language:
The set of binary strings that contain both substring 010 and substring 101.
The set of all binary strings ending with 00 or 01 or 10.
The set of binary strings that contain both 001 and 110 as substrings or contain neither 001 nor 110 as a substring.
The set of binary strings in which both the fourth symbol from the right and the fourth from the left symbols are 0. [Note: Both strings 0110 and 10101 belong to this set.]
Consider the following multiplication table on :
Construct NFA's for the following languages:
.
.
.
Find a DFA accepting the language .
Construct an NFA accepting the set of binary strings of an odd length which contain the substring 00.
Find a regular expression for the language accepted by NFA in Figure 2.29(a).
For each of the following regular expressions , construct a DFA that accepts :
.
.
.
For each of the following languages, find an NFA that accepts it:
.
.
.
Figure 2.41 shows an NFA accepting , constructed based on the method of Example 2.22. The four -moves cannot be eliminated by the rule of Theorem 1.25. Apply the method in the proof of Theorem 2.31 to reduce some of its -moves. Can you find, from this example, a more general rule (than Theorem 1.25) to eliminate redundant -transitions?
Figure 2.41: An NFA accepting 0*.
For each of the languages accepted by NFA's of Figure 2.42, find a regular expression for it.
Figure 2.42: Two NFA’s for Exercise 4.
Let be an . Construct an such that .
Let be a substitution over . Assume that is a regular language, and that is a regular language for each . Then, is also a regular language.
Show that for any language , if is regular then is also regular.
Let be a regular language over a positive integer and a mapping from to . Prove that
is regular.
Prove that if is regular, so is .
Show that if and are regular languages over , then
is also regular.
Show that if is a regular language, so is
Show that if is a regular language, so is
Show that if is a regular set, so is
Let and be two regular languages. Show that the language defined by
is also regular.
Show that if is regular, so is
Prove the following identity:
, where .
.
For any two bits denotes the exclusive-or of and ; that is, and . For any two binary strings and with denotes the bitwise exclusive-or of and . For example, if and , then . Let and . Find a regular expression for each of the following languages:
.
.
.
Show that if and are regular languages, so are the following languages:
.
.
, where is a fixed string.
.
.
.
.
Give an alternative proof for Example 2.42 based on the following idea: We may simulate NFA on together with on by simulating two moves of and one move of at each step. (Thus, the new NFA for has only tracks.)
Show that if and are regular languages, so are the following:
.
.
.
.
.
.
.
.
Consider a Boolean function . For any binary strings of equal length, denote by the bitwise function on . That is, if for , , where each is a bit in , then is equal to
Show that if languages are regular, then language
\begin{aligned} \left\{ f\left(x_{1}, x_{2}, \cdots , x_{n}\right) \mid & \left|x_{1}\right|=\left|x_{2}\right|=\cdots =\left|x_{n}\right| \\ & x_{1} \in A_{1}, x_{2} \in A_{2}, \cdots , x_{n} \in A_{n}\right\} \end{aligned}is also regular.
In Exercise 3(c) above, show that, for any regular language , the number of distinct 's is finite. Find an upper bound for this number, assuming that is accepted by a DFA with states.
Are the following statements true? Prove or disprove your answer.
If is regular and , then is regular.
If is regular and , then is regular.
If is regular, then is regular.
If and are regular, then is regular.
If and are regular, then is regular.
Show that every regular language in can be represented in the form
for some integer constants , and .
A subset of nonnegative integers is ultimately periodic if there exists two positive integers such that, for all implies . Prove the following statements:
For any regular language is ultimately periodic.
A language over is regular if and only if is ultimately periodic.
If is a mapping from integers to integers such that is ultimately periodic for every ultimately periodic set , then the set is regular for every pair of regular sets and .
If is a mapping from integers to integers such that is ultimately periodic for every ultimately periodic set , then the set is regular for every regular set .
Apply Exercise 10(d) above to prove the following results:
If is a regular language, then so is . [Hint: Use Fermat's theorem, which states that for any odd integer , there exists an integer such that .]
If is a regular language, then so is .
Let . Find all equivalence classes of .
Let be the set of nonempty binary strings starting and ending with the same symbol. Find all equivalence classes of .
Show that is regular if and only if there exists a positive integer such that if and only if for every with , .
Find the minimum DFA for language .
Construct the minimum DFA for language .
Find the minimum DFA equivalent to the DFA of Figure 2.47.
Figure 2.47: DFA M.
Show that the following language is not regular:
Show that is not regular.
For any language , define an equivalence relation by
Show that is regular if and only if .
Find all equivalence classess of for the following languages:
.
.
.
The set of binary strings in which each block of four symbols have at least two 0's.
, where is the number of occurrences of symbol in .
For each of the following languages , show that and so is not regular.
.
.
.
.
For each of the following languages , show that no two strings can be in the same equivalence class of .
.
.
Construct the minimum DFA's for languages accepted by DFA's in Figure 2.52(a) and 2.52(b).
Figure 2.52: Two DFA’s for Exercise 4.
Construct a minimum DFA equivalent to the NFA of Figure 2.53.
Figure 2.53: An NFA for Exercise 5.
is not a regular language.
is not a regular language.
Show that is not a regular language.
Show that is not regular.
Show that the language is not regular.
Consider the following multiplication table on :
Recall, from Example 2.28, that for any string in , denotes the value obtained by multiplying symbols in from left to right. Show that the set
is not regular.
Show that the set of all strings over alphabet
that represent correct multiplication is not regular. For example, the relation
implies that the following string is in :
Show that the set of the binary expansions of the integers in set is regular, but the set of the ternary expansions (base 3 representations) of the integers in is not regular.
Show that is not regular.
Show that is not regular.
Let be a regular language. Show that
is not necessarily regular.
Show that the following languages are not regular.
.
.
.
.
.
.
For each of the following languages, determine whether it is regular. Present a proof for your answer.
The set of binary strings having an equal number of 0 's and 1 's.
The set of binary strings having an equal number of 01's and 10's.
The set of binary strings having an equal number of 010's and 101's.
.
.
.
Let be the alphabet of Example 2.65.
Show that the set of all strings over alphabet that represent correct division is not regular. For example,
implies that the following string is in :
Show that the set of all strings over that represent correct multiplication, with the second multiplier equal to 3, is regular.
Is it true that for any regular language over , the set is also regular? Prove your answer.
Prove the following stronger form of the pumping lemma: For any regular language and any positive integer , there exists a positive integer such that any string in with can be decomposed into such that and for any .
Find a regular language such that
is not regular.
Let and be regular sets over alphabet . Which of the following languages, if any, are necessarily regular?
.
.
.
.
.
.
Consider the language
where and are nonempty sets over alphabet . Can you find regular sets such that is not regular? Can you find regular sets such that is regular? What if must be infinite regular sets?
Is the language regular? Prove your answer.
Let be a language over alphabet . Show that is regular. [Hint: Prove and use the fact that if and are relatively prime natural numbers, then for any integer , there exist nonnegative integers and such that .]