Chapter 18

Finite Automata: Transducers and Recognizers

[25/100%]
Show
LaTeX
Problem 431

A finite transducer M=(Q,Σ,Ω,P1,q0)\mathfrak {M}=\left(Q, \Sigma , \Omega , P_{1}, q_{0}\right) is defined as follows: Q={q0,q1,q2,q3},Σ={0,1},Ω={A,P,T}Q=\left\{ q_{0}, q_{1}, q_{2}, q_{3}\right\} , \Sigma =\left\{ 0,1\right\} , \Omega =\left\{ A, P, T\right\}, and the program P1P_{1} is given by the table in Fig. 23.

?
(a)

Find the result of the transducer M\mathfrak {M} operating on the word 010100.

(b)

On what input will M\mathfrak {M} output the result APAPAT?

Problem 432

A finite transducer Mc=(Q,Σ,Ω,P2,q0)\mathfrak {M}_{c}=\left(Q, \Sigma , \Omega , P_{2}, q_{0}\right) is defined as follows: Q={q0,q1,q2,q3},Σ={0,1},Ω={0,1}Q=\left\{ q_{0}, q_{1}, q_{2}, q_{3}\right\} , \Sigma =\left\{ 0,1\right\} , \Omega =\left\{ 0,1\right\}, and the program P2P_{2} is given by the table in Fig. 23. This transducer subtracts some constant cc from the input number xx written in binary, that is, when c⩽xc \leqslant x it outputs the number y=x−cy=x-c in binary. What is this constant cc? The digits in the binary representation of the numbers go from least to most significant, that is, the number ten looks like this: 0101.

?
Problem 433

A change-making machine has a slot for inserting coins and a hopper for dispensing them. The machine accepts coins of denominations 1, 2, and 10 rubles and makes change in 5-ruble coins. The display shows the amount already inserted, and as soon as the amount becomes sufficient, the machine immediately dispenses the required number of 5-ruble coins.

Construct a finite transducer modeling the operation of this machine. Determine the input and output alphabets and construct its program.

?
Problem 434

A coffee vending machine has a slot for receiving coins, a button whose press, once a sufficient amount has been paid, dispenses the coffee, and a hopper through which it dispenses change to the buyer. The machine accepts coins of denominations 1, 2, and 5 rubles. A cup of coffee costs 8 rubles. While the amount received is insufficient, a red light is on. If the amount received by the machine becomes greater than or equal to 8 rubles, then a green light turns on, and after the button is pressed the machine pours the coffee and, if needed, dispenses change using the smallest number of coins. If the machine receives a coin while the green light is on, it immediately returns it.

Construct a finite transducer modeling the operation of this machine. Determine the input and output alphabets and construct its program.

?
Problem 435

An electronic clock has a display showing hours, minutes, and seconds, along with two control buttons. The first button switches the clock from normal mode into time-setting mode — first into hour-setting, then minute-setting, then second-setting, and then returns it to normal mode. The second button does nothing in normal mode, while in setting mode pressing it increments by one the number of hours, minutes, or seconds currently being set, respectively.

Construct a finite transducer that models the operation of the clock. Its input consists of signals from presses of the two buttons, and its output consists of signals for changing the mode and incrementing the corresponding number. Draw the diagram of the transducer.

Fig. 24: Automaton programs from Problems 439, 440, and 441.Fig. 24: Automaton programs from Problems 439, 440, and 441.

?
Problem 436

Construct a finite transducer that multiplies a number in binary notation by 3. The digits are written in order of increasing place value (as in Problem 432 on p. 129).

?
Problem 437

Construct a finite transducer that performs integer division of a number in decimal notation by 3. The digits are written in order of decreasing place value (in the "usual" order).

?
Problem 438

Determine which languages can be recognized by deterministic finite automata with alphabet Σ={0,1}\Sigma =\left\{ 0,1\right\} and state set Q={q0,q1}Q=\left\{ q_{0}, q_{1}\right\}.

?
Problem 439

Let Σ={a,b},Q={q0,q1,q2,q3,q4,q5},F={q3,q4}\Sigma =\left\{ a, b\right\} , Q=\left\{ q_{0}, q_{1}, q_{2}, q_{3}, q_{4}, q_{5}\right\} , F=\left\{ q_{3}, q_{4}\right\}, and let the transition function P1P_{1} of the finite automaton M=(Q,Σ,P1,q0,F)\mathfrak {M}=\left(Q, \Sigma , P_{1}, q_{0}, F\right) be given by the table shown in Fig. 24. Determine which of the following three words are recognized by the automaton M:w=aaabbabab,v=babbbabba\mathfrak {M}: w=a a a b b a b a b, v=b a b b b a b b a, u=ababaaab?u=a b a b a a a b?

?
Problem 440

The language LL consists of all words that begin with the letter bb and contain a number of letters aa that is a multiple of three. Determine which of the following three deterministic finite automata recognize the language L:Mi=({q0,q1,q2,q3,q4},{a,b},Pi,q0,{q1}),i=2,3,4L: \mathfrak {M}_{i}=\left(\left\{ q_{0}, q_{1}, q_{2}, q_{3}, q_{4}\right\} ,\left\{ a, b\right\} , P_{i}, q_{0},\left\{ q_{1}\right\} \right), i=2,3,4, whose programs PiP_{i} are given by the table shown in Fig. 24.

?
Problem 441

The components of the finite automaton M=(Q,Σ,P5,q0,F)\mathfrak {M}=\left(Q, \Sigma , P_{5}, q_{0}, F\right) are Q={q0,q1,q2,q3},Σ={a,b},F={q3}Q=\left\{ q_{0}, q_{1}, q_{2}, q_{3}\right\} , \Sigma =\left\{ a, b\right\} , F=\left\{ q_{3}\right\}, and the program P5P_{5} is given by the table in Fig. 24. Prove that the automaton M\mathfrak {M} recognizes the language consisting

precisely of those words in the alphabet {a,b}\left\{ a, b\right\} that end with the fragment abaa b a.

?
Problem 442

Prove that the automaton shown in Fig. 25 recognizes the language consisting of all words that end in bab a and do not contain aaa a.

Fig. 25: Automaton from Problem 442.Fig. 25: Automaton from Problem 442.

?
Problem 443

By induction on the length of the word ww, prove the following statement: (q,wx)⊢M∗(p,x)(q, w x) \vdash_{\mathfrak {M}}^{*}(p, x) if and only if there is a path in DM\mathfrak {D}_{\mathfrak {M}} from qq to pp carrying ww.

?
Problem 444

Construct deterministic finite automata that recognize the following languages over the alphabet Σ={a,b}\Sigma =\left\{ a, b\right\}:

?
(a)

L={w: the length of w is divisible by 5}L=\left\{ w:\text{ the length of }w\text{ is divisible by 5}\right\};

(b)

L={w:w does not contain the substrings "aab" and "bba"}L=\left\{ w: w\text{ does not contain the substrings "aab" and "bba"}\right\};

(c)

L={w:w contains an even number of letters a and an odd number of letters b}L=\left\{ w: w\text{ contains an even number of letters }a\text{ and an odd number of letters }b\right\};

(d)

L={w: the number of letters a in the word w is divisible by 3, and the number of letters b — by 2}L=\left\{ w:\text{ the number of letters }a\text{ in the word }w\text{ is divisible by 3, and the number of letters }b\text{ — by 2}\right\}.

Problem 445

Construct a deterministic finite automaton that verifies the correctness of addition. The input is a sequence of "three-story" symbols, in which the top level holds a digit of the first addend, the middle level a digit of the second addend, and the bottom level a digit of the proposed sum. The automaton must accept the word if the result of the addition written on the bottom level is correct. The digits of all the numbers are written in order of increasing place value.

?
Problem 446

Construct deterministic finite automata recognizing the following languages over the alphabet {0,1}\left\{ 0,1\right\}:

?
(a)

L1L_{1} — all words in which the fourth position from the end is 1;

(b)

L2L_{2} — all words that contain the substrings 111 and 010 and do not contain the substring 001;

(c)

L3L_{3} — all words ending in 10, 11, or 01.

Problem 447

Construct a deterministic finite automaton M\mathfrak {M} with alphabet Σ={∧,∨,0,1}\Sigma =\left\{ \wedge , \vee , 0,1\right\} that accepts only those words which are true DNFs.

?
Problem 448

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.

Problem 449

Let M=(Q,Σ,P,q,{p})\mathfrak {M}=(Q, \Sigma , P, q,\left\{ p\right\} ) be a nondeterministic finite automaton, where Q={q,p,s},Σ={0,1},P={q,0→p;q,0→s;q,1→q;p,0→q;p,0→p;s,1→q;s,1→p}Q=\left\{ q, p, s\right\} , \Sigma =\left\{ 0,1\right\} , P=\left\{ q, 0 \rightarrow p ; q, 0 \rightarrow s ; q, 1 \rightarrow q ; p, 0 \rightarrow q ; p, 0 \rightarrow p ; s, 1 \rightarrow q ; s, 1 \rightarrow p\right\}.

Determine which of the following three deterministic automata Mi=(Qi,Σ,Pi,q,Fi)\mathfrak {M}_{i}=\left(Q_{i}, \Sigma , P_{i}, q, F_{i}\right) are equivalent to M\mathfrak {M}:

?
(a)

Q1={q,ps,pq,pqs},F1={ps,pq,pqs},P1={q,0→ps;q,1→q;ps,0→pq;ps,1→pq;pq,0→pqs;pq,1→q;pqs,0→pqs;pqs,1→pq}Q_{1}=\left\{ q, p s, p q, p q s\right\} , F_{1}=\left\{ p s, p q, p q s\right\} , P_{1}=\left\{ q, 0 \rightarrow p s ; q, 1 \rightarrow q ; p s, 0 \rightarrow p q ; p s, 1 \rightarrow p q ; p q, 0 \rightarrow p q s ; p q, 1 \rightarrow q ; p q s, 0 \rightarrow p q s ; p q s, 1 \rightarrow p q\right\}.

(b)

Q2={q,p,s,ps,qs,pq,pqs,∅},F2={ps,pq,pqs}Q_{2}=\left\{ q, p, s, p s, q s, p q, p q s, \varnothing \right\} , F_{2}=\left\{ p s, p q, p q s\right\}, P2={q,0→ps;q,1→q;p,0→pq;p,1→q;ps,0→qs;ps,1→pq;pq,0→pqs;pq,1→q;qs,0→ps;qs,1→q;pqs,0→pqs;pqs,1→pq;∅,0→∅;∅,1→∅}P_{2}=\left\{ q, 0 \rightarrow p s ; q, 1 \rightarrow q ; p, 0 \rightarrow p q ; p, 1 \rightarrow q ; p s, 0 \rightarrow q s ; p s, 1 \rightarrow p q ; p q, 0 \rightarrow p q s ; p q, 1 \rightarrow q ; q s, 0 \rightarrow p s ; q s, 1 \rightarrow q ; p q s, 0 \rightarrow p q s ; p q s, 1 \rightarrow p q ; \varnothing , 0 \rightarrow \varnothing ; \varnothing , 1 \rightarrow \varnothing \right\}.

(c)

Q3={q,p,s,ps,qs,pq,pqs,∅},F3={p,ps,pq,pqs,s,qs},P3={q,0→ps;q,1→q;p,0→pq;p,1→q;s,0→∅;s,1→pq;ps,0→pq;ps,1→pq;pq,0→pqs;pq,1→q;qs,0→ps;qs,1→q;pqs,0→pqs;pqs,1→pq;∅,0→∅;∅,1→∅}Q_{3}=\left\{ q, p, s, p s, q s, p q, p q s, \varnothing \right\} , F_{3}=\left\{ p, p s, p q, p q s, s, q s\right\} , P_{3}=\left\{ q, 0 \rightarrow p s ; q, 1 \rightarrow q ; p, 0 \rightarrow p q ; p, 1 \rightarrow q ; s, 0 \rightarrow \varnothing ; s, 1 \rightarrow p q ; p s, 0 \rightarrow p q ; p s, 1 \rightarrow p q ; p q, 0 \rightarrow p q s ; p q, 1 \rightarrow q ; q s, 0 \rightarrow p s ; q s, 1 \rightarrow q ; p q s, 0 \rightarrow p q s ; p q s, 1 \rightarrow p q ; \varnothing , 0 \rightarrow \varnothing ; \varnothing , 1 \rightarrow \varnothing \right\}.

Problem 450

Using the determinization procedure, construct deterministic automata equivalent to the following nondeterministic finite automata N\mathfrak {N} with alphabet Σ={a,b}\Sigma =\left\{ a, b\right\}:

?
(a)

N=({q0,q1,q2},Σ,P,q0,{q2})\mathfrak {N}=\left(\left\{ q_{0}, q_{1}, q_{2}\right\} , \Sigma , P, q_{0},\left\{ q_{2}\right\} \right) with program P={q0,a→q1;q0,ε→q1;q1,b→q2;q1,ε→q2;q2,b→q2};P=\left\{ q_{0}, a \rightarrow q_{1} ; q_{0}, \varepsilon \rightarrow q_{1} ; q_{1}, b \rightarrow q_{2} ; q_{1}, \varepsilon \rightarrow q_{2} ; q_{2}, b \rightarrow q_{2}\right\} ;

(b)

N=({q0,q1,q2},Σ,P,q0,{q2})\mathfrak {N}=\left(\left\{ q_{0}, q_{1}, q_{2}\right\} , \Sigma , P, q_{0},\left\{ q_{2}\right\} \right) with program P={q0,a→q1;q0,a→q2;q1,b→q2;q1,ε→q2;q2,b→q0}P=\left\{ q_{0}, a \rightarrow q_{1} ; q_{0}, a \rightarrow q_{2} ; q_{1}, b \rightarrow q_{2} ; q_{1}, \varepsilon \rightarrow q_{2} ; q_{2}, b \rightarrow q_{0}\right\}.

Problem 451

Let M=(Q,Σ,P,q0,F)\mathfrak {M}=\left(Q, \Sigma , P, q_{0}, F\right) be a nondeterministic finite automaton, in which Q={q0,q1,q2,q3},Σ={a,b},F={q1,q3}Q=\left\{ q_{0}, q_{1}, q_{2}, q_{3}\right\} , \Sigma =\left\{ a, b\right\} , F=\left\{ q_{1}, q_{3}\right\}, P={q0,a→q0;q0,a→q1;q0,b→q2;q1,b→q0;q2,a→q0;q2,a→q3;q2,b→q1;q2,b→q2;q2,b→q3;q3,a→q0;q3,a→q3}P=\left\{ q_{0}, a \rightarrow q_{0} ; q_{0}, a \rightarrow q_{1} ; q_{0}, b \rightarrow q_{2} ; q_{1}, b \rightarrow q_{0} ; q_{2}, a \rightarrow q_{0} ; q_{2}, a \rightarrow q_{3} ; q_{2}, b \rightarrow q_{1} ; q_{2}, b \rightarrow q_{2} ; q_{2}, b \rightarrow q_{3} ; q_{3}, a \rightarrow q_{0} ; q_{3}, a \rightarrow q_{3}\right\}.

?
(a)

Determine which of the following words are recognized by the automaton M:w1=aaabab,w2=ababbba,w3=bbaabba,w4=bbbaab\mathfrak {M}: w_{1}=a a a b a b, w_{2}=a b a b b b a, w_{3}=b b a a b b a, w_{4}=b b b a a b.

(b)

Determinize M\mathfrak {M}.

(c)

Determine which language M\mathfrak {M} recognizes.

(d)

Construct a simpler variant of a deterministic automaton recognizing the same language.

Problem 452

Let M=(Q,Σ,P,q0,F)\mathfrak {M}=\left(Q, \Sigma , P, q_{0}, F\right) be a nondeterministic finite automaton, where Q={q0,q1,q2,q3,q4,q5},Σ={0,1},F={q5}Q=\left\{ q_{0}, q_{1}, q_{2}, q_{3}, q_{4}, q_{5}\right\} , \Sigma =\left\{ 0,1\right\} , F=\left\{ q_{5}\right\}, and PP is defined in the table in Fig. 26 on the facing page (a dash means the absence of the corresponding transitions).

?
(a)

Determine which of the following words are recognized by the automaton M:w=101,v=110000,u=01,x=10,y=11,z=1\mathfrak {M}: w=101, v=110000, u=01, x=10, y=11, z=1.

ΣΣ\Sigma \Sigma01ε\varepsilon
q0q_{0}-q1,q5q_{1}, q_{5}-
q1q_{1}--q2,q3q_{2}, q_{3}
q2q_{2}q5q_{5}q4q_{4}-
q3q_{3}q3q_{3}-q4q_{4}
q4q_{4}q4,q5q_{4}, q_{5}-q5q_{5}
q5q_{5}---
: Fig. 26: Program of the automaton from Problem 452.
(b)

Prove that the automaton M\mathfrak {M} recognizes the following language

L={10i:i⩾0}∪{110i:i⩾0}. L=\left\{ 10^{i}: i \geqslant 0\right\} \cup \left\{ 110^{i}: i \geqslant 0\right\} .
(c)

Construct a deterministic finite automaton equivalent to M\mathfrak {M}.

Problem 453

Apply the determinization procedure and construct a deterministic automaton equivalent to the nondeterministic finite automaton shown in Fig. 27.

Fig. 27: Automaton from Problem 453.Fig. 27: Automaton from Problem 453.

?
Problem 454

The language LL over the alphabet Σ={a1,…,ak}\Sigma =\left\{ a_{1}, \ldots , a_{k}\right\} consists of all words in which at least one letter of the alphabet Σ\Sigma is missing.

?
(a)

Construct a nondeterministic automaton with k+1k+1 states recognizing LL.

(b)

Prove that no deterministic automaton with fewer than 2k2^{k} states can recognize LL.

Problem 455

A nondeterministic finite automaton N=(Q,Σ,P,q0,F)\mathfrak {N}=\left(Q, \Sigma , P, q_{0}, F\right) over the alphabet Σ={a,b,c}\Sigma =\left\{ a, b, c\right\} with nn states Q={q0,q1,…,qn−1}Q=\left\{ q_{0}, q_{1}, \ldots , q_{n-1}\right\} and set of accepting states F={q0}F=\left\{ q_{0}\right\} is shown in Fig. 28.

Fig. 28: Automaton from Problem 455.Fig. 28: Automaton from Problem 455.

Let M=(P(Q),Σ,P′,{q0},F′)\mathfrak {M}=\left(\mathrm{P}(Q), \Sigma , P^{\prime },\left\{ q_{0}\right\} , F^{\prime }\right) be the automaton obtained from N\mathfrak {N} via the determinization procedure. Prove that

?
(a)

for any state R∈P(Q)R \in \mathrm{P}(Q) of the automaton M\mathfrak {M} there exists a word wRw_{R} that takes the initial state {q0}\left\{ q_{0}\right\} to RR;

(b)

for any states R,S∈P(Q),R≠SR, S \in \mathrm{P}(Q), R \neq S, of the automaton M\mathfrak {M} there exists a word wR,Sw_{R, S} that takes one of the states RR or SS to some accepting state, and the other to a non-accepting one;

(c)

there is no deterministic finite automaton that would be equivalent to N\mathfrak {N} and have fewer than 2n2^{n} states.