Finite Automata
[12/100%]A coffee vending machine has a slot for receiving coins, a button whose press, after a sufficient amount has been paid, dispenses coffee, and a receptacle through which it gives the customer change. 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, a green light turns on, and after the button is pressed the machine pours the coffee and, if necessary, 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 that models the operation of this machine. Determine the input and output alphabets and construct its program.
An electronic clock has a display showing hours, minutes, and seconds, as well as two control buttons. The first button switches the clock from normal mode to time-setting mode — first to setting the hours, then the minutes, then the seconds, and then returns it to normal mode. The second button does nothing in normal mode, while in setting mode pressing it increases by one the number of the hours, minutes, or seconds being set, respectively.
Construct a finite transducer that models the operation of the clock. On input it receives press signals from the two buttons, and on output it produces signals for changing the mode and for incrementing the corresponding number. Draw the diagram of the transducer.
Construct a finite transducer that multiplies a number written in binary by 3. The digits in the binary representation of numbers go from least significant to most significant, that is, the number ten looks like this: 0101.
Construct a finite transducer that computes the integer division by 3 of a number written in decimal. The digits are written in decreasing order of place value (in the "usual" order).
Prove Proposition 93 on p. 286.
Proposition 93: For a finite transducer , its configuration , and a natural number , there exists at most one configuration such that .
Prove that the automaton shown in Fig. 83 on p. 307 recognizes the language consisting of all words ending in "aba".
Fig. 83. Diagram of the automaton from Example 73; the initial state is , and the sole accepting state is .
By induction on the length of the word , prove the following statement: if and only if in there is a path from to carrying . Derive from it Lemma 96 on p. 293.
Lemma 96: The automaton accepts the word if and only if in the diagram there is a path carrying from the initial state to some accepting state , that is, takes to an accepting state .
Construct deterministic finite automata that recognize the following languages over the alphabet :
;
;
;
.
Above, in Example 68 on p. 288, a transducer performing the addition of two binary numbers was constructed. Construct a deterministic finite automaton that checks the correctness of the addition. The input consists of "three-level" symbols, in which the top level contains a digit of the first addend, the middle level a digit of the second addend, and the bottom level a digit of the presumed sum. The automaton should accept the word if the result of the addition written on the bottom level is correct. The digits of all numbers are written in order of increasing place value.
Prove Lemma 97 on p. 297.
Definition 126 (Product of automata): Let and be two finite automata with a common input alphabet . A product of the automata and is any automaton of the form , whose program contains the command whenever and . (No condition is imposed on the set of accepting states of , so a product is not a uniquely determined operation — different choices of give different automata.)
Lemma 97: If is a product of and , then for any two states and of and any input word , the following holds: takes to in the automaton if and only if simultaneously takes to in and to in .
Using the determinization procedure, construct deterministic automata equivalent to the following nondeterministic finite automata with alphabet :
with program ;
with program .
A nondeterministic finite automaton over the alphabet with states and set of accepting states is shown in Fig. 85 on the next page. Let be the automaton obtained from by applying the determinization procedure. Prove that
Fig. 85. Automaton from Problem 246.
for any state of the automaton there exists a word that takes the initial state to ;
for any states , of the automaton there exists a word that takes one of the states or to some accepting state, and the other to a non-accepting one;
there is no deterministic finite automaton equivalent to with fewer than states.