Product automaton construction

[12/75%]
Show
LaTeX

Prove Lemma 97 on p. 297.

Definition 126 (Product of automata): Let M1=(Q1,Σ,P1,q01,F1)\mathfrak {M}_{1}=(Q_{1}, \Sigma , P_{1}, q_{0}^{1}, F_{1}) and M2=(Q2,Σ,P2,q02,F2)\mathfrak {M}_{2}=(Q_{2}, \Sigma , P_{2}, q_{0}^{2}, F_{2}) be two finite automata with a common input alphabet Σ\Sigma. A product of the automata M1\mathfrak {M}_{1} and M2\mathfrak {M}_{2} is any automaton N\mathfrak {N} of the form N=(Q1×Q2,Σ,P,(q01,q02),F)\mathfrak {N}=(Q_{1} \times Q_{2}, \Sigma , P, (q_{0}^{1}, q_{0}^{2}), F), whose program PP contains the command (q1,q2),a→(p1,p2)(q_{1}, q_{2}), a \rightarrow (p_{1}, p_{2}) whenever q1,a→p1∈P1q_{1}, a \rightarrow p_{1} \in P_{1} and q2,a→p2∈P2q_{2}, a \rightarrow p_{2} \in P_{2}. (No condition is imposed on the set of accepting states FF of N\mathfrak {N}, so a product is not a uniquely determined operation — different choices of FF give different automata.)

Lemma 97: If N\mathfrak {N} is a product of M1\mathfrak {M}_{1} and M2\mathfrak {M}_{2}, then for any two states (q1,q2)(q_{1}, q_{2}) and (p1,p2)(p_{1}, p_{2}) of N\mathfrak {N} and any input word ww, the following holds: ww takes (q1,q2)(q_{1}, q_{2}) to (p1,p2)(p_{1}, p_{2}) in the automaton N\mathfrak {N} if and only if ww simultaneously takes q1q_{1} to p1p_{1} in M1\mathfrak {M}_{1} and q2q_{2} to p2p_{2} in M2\mathfrak {M}_{2}.

?

Two languages are given over the alphabet Σ={a,b}\Sigma =\left\{ a, b\right\}:

L1={w: the number of letters b in w is a multiple of three};L2={w:w does not contain the substring aaa}. \begin{aligned} & L_{1}=\left\{ w: \text{ the number of letters } b \text{ in } w \text{ is a multiple of three}\right\} ; \\ & L_{2}=\left\{ w: w \text{ does not contain the substring } a a a\right\} . \end{aligned}
?
(a)

Construct deterministic finite automata A\mathfrak {A} and B\mathfrak {B} recognizing the languages L1L_{1} and L2L_{2}, respectively.

(b)

Construct the product of these automata C=A×B\mathfrak {C}=\mathfrak {A} \times \mathfrak {B} and determine its sets of accepting states F1,F2F_{1}, F_{2}, and F3F_{3}, for recognizing the languages R1=L1∪L2,R2=L1∩L2,R3=L1\L2R_{1}=L_{1} \cup L_{2}, R_{2}=L_{1} \cap L_{2}, R_{3}=L_{1} \backslash L_{2}, respectively.

For each of the following languages, use the product automaton method to construct a DFA that accepts the language:

?
(a)

The set of binary strings beginning with 010 or ending with 101.

(b)

The set of binary strings having a substring 010 but not having a substring 101.

(c)

The set of binary strings beginning with 010, ending with 101 and having a substring 0000.

For each of the following languages, construct a DFA that accepts the language:

?
(a)

The set of binary strings that contain both substring 010 and substring 101.

(b)

The set of all binary strings ending with 00 or 01 or 10.

(c)

The set of binary strings that contain both 001 and 110 as substrings or contain neither 001 nor 110 as a substring.

(d)

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 a Boolean function f(a1,a2,⋯ ,an)f\left(a_{1}, a_{2}, \cdots , a_{n}\right). For any nn binary strings x1,x2,⋯ ,xnx_{1}, x_{2}, \cdots , x_{n} of equal length, denote by f(x1,x2,⋯ ,xn)f\left(x_{1}, x_{2}, \cdots , x_{n}\right) the bitwise function ff on x1,x2,⋯ ,xnx_{1}, x_{2}, \cdots , x_{n}. That is, if xi=xi1xi2…xikx_{i}=x_{i_{1}} x_{i_{2}} \ldots x_{i_{k}} for i=1,2i=1,2, …,n\ldots , n, where each xijx_{i_{j}} is a bit in {0,1}\left\{ 0,1\right\}, then f(x1,x2,…,xn)f\left(x_{1}, x_{2}, \ldots , x_{n}\right) is equal to

f(x11,x21,…,xn1)⋅f(x12,x22,…,xn2)⋯f(x1k,x2k,…,xnk) f\left(x_{11}, x_{21}, \ldots , x_{n 1}\right) \cdot f\left(x_{12}, x_{22}, \ldots , x_{n 2}\right) \cdots f\left(x_{1 k}, x_{2 k}, \ldots , x_{n k}\right)

Show that if languages A1,A2,⋯ ,AnA_{1}, A_{2}, \cdots , A_{n} 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.

?

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.

?

Show that if AA and BB are regular languages over {0,1}\left\{ 0,1\right\}, then

A∨B={x∨y∣x∈A,y∈B,∣x∣=∣y∣} A \vee B=\left\{ x \vee y \mid x \in A, y \in B, \left|x\right|=\left|y\right|\right\}

is also regular.

?

Show that if AA is a regular language and BB is a context-free language, then A∩BA \cap B is a context-free language.

?
Problem 1.4 from Sipser M. "Introduction to the Theory of Computation" [Sip13]More problems in Section 1.1 "Exercises"

Each of the following languages is the intersection of two simpler languages. In each part, construct DFAs for the simpler languages, then combine them using the construction discussed in footnote 3 (page 46) to give the state diagram of a DFA for the language given. In all parts, Σ={a,b}\Sigma =\left\{ \mathrm{a}, \mathrm{b}\right\}.

?
(a)

{w∣w has at least three a’s and at least two b’s}\left\{ w \mid w\text{ has at least three a's and at least two b's}\right\}

(b)

ᴬ {w∣w has exactly two a’s and at least two b’s}\left\{ w \mid w\text{ has exactly two a's and at least two b's}\right\}

(c)

{w∣w has an even number of a’s and one or two b’s}\left\{ w \mid w\text{ has an even number of a's and one or two b's}\right\}

(d)

ᴬ {w∣w has an even number of a’s and each a is followed by at least one b}\left\{ w \mid w\text{ has an even number of a's and each }\mathbf{a}\text{ is followed by at least one }\mathbf{b}\right\}

(e)

{w∣w starts with an a and has at most one b}\left\{ w \mid w\text{ starts with an }\mathbf{a}\text{ and has at most one }\mathbf{b}\right\}

(f)

{w∣w has an odd number of a’s and ends with a b}\left\{ w \mid w\text{ has an odd number of a's and ends with a b}\right\}

(g)

{w∣w has even length and an odd number of a’s}\left\{ w \mid w\text{ has even length and an odd number of a's}\right\}

Problem 1.5 from Sipser M. "Introduction to the Theory of Computation" [Sip13]More problems in Section 1.1 "Exercises"

Each of the following languages is the complement of a simpler language. In each part, construct a DFA for the simpler language, then use it to give the state diagram of a DFA for the language given. In all parts, Σ={a,b}\Sigma =\left\{ \mathrm{a}, \mathrm{b}\right\}.

?
(a)

ᴬ {w∣w does not contain the substring ab}\left\{ w \mid w\text{ does not contain the substring }\mathbf{a b}\right\}

(b)

ᴬ {w∣w does not contain the substring baba }\left\{ w \mid w\text{ does not contain the substring baba }\right\}

(c)

{w∣w contains neither the substrings ab nor ba}\left\{ w \mid w\text{ contains neither the substrings ab nor ba}\right\}

(d)

{w∣w is any string not in a∗ b∗}\left\{ w \mid w \text{ is any string not in } \mathrm{a}^{*} \mathrm{~ b}^{*}\right\}

(e)

{w∣w is any string not in (ab+)∗}\left\{ w \mid w \text{ is any string not in } \left(\mathrm{ab}^{+}\right)^{*}\right\}

(f)

{w∣w is any string not in a∗∪ b∗}\left\{ w \mid w \text{ is any string not in } \mathrm{a}^{*} \cup \mathrm{~ b}^{*}\right\}

(g)

{w∣w is any string that doesn’t contain exactly two a’s}\left\{ w \mid w\text{ is any string that doesn't contain exactly two a's}\right\}

(h)

{w∣w is any string except a and b}\left\{ w \mid w\text{ is any string except a and b}\right\}

References

[ДДК+21a] Дехтярь М.И., Дудаков С.М., Карлов М.И., Карлов Б.Н. Лекции по дискретной математике. 3-е изд., Тверской государственный университет, 2021.
[ДДК+21b] Дехтярь М.И., Дудаков С.М., Карлов М.И., Карлов Б.Н. Задачник по дискретной математике. 2-е изд., Тверской государственный университет, 2021.
[DuKo01] Du D., Ko K. Problem Solving in Automata, Languages, and Complexity. John Wiley & Sons, 2001.
[Sip13] Sipser M. Introduction to the Theory of Computation. 3rd ed., Cengage Learning, 2013.