We model a machine as a set of states, inputs which lead to a change in state, a clock to synchronize the machine world, and outputs, which result from a particular state. We use tables and graphs to describe how the inputs relate to changes in state and the outputs of each state, then practice creating simple finite-state machines.
Finite-state machines can be used to recognize input, and we will look at the kinds of input that can be recognized, as well as construct the machines that recognize given input. Furthermore, some machines are overly complicated, in that we can simplify them and get the same operation. We will examine some ways in which we can ``minimize'' a finite-state machine.
Definition: A finite-state machine M is a structure where
Table: Elements of a finite-state machine.
We assume discrete times, synchronized by a clock, so that
and that
We represent and by
A summary of these elements for Example 16, p. 559/545:
Table: Elements of finite-state machine of Example 16, p. 559/545.
Practice 35, p. 561/546. (Table from graph: first of all, what are in this example?)
Practice 36, p. 561/546.
Practice 34, p. 561/546.
Exercise 4, p. 576/563.
Note: major goof - the fourth sum at the bottom of page 561 of the 4th edition is wrong: We know that 1+1=10 in binary!
In section 7.2 we saw how one might create a logic network in hardware for the addition of binary numbers. We now consider how this can be incorporated into a finite-state machine which is analogous (p. 561/547).
We must specify the five elements of a finite-state machine: . What is the set of states, what the set of inputs, what the set of outputs, and how are the functions and defined?
Practice 37, p. 562/547
Practice 38, p. 563/548
Now let's try something a little different:
Exercise 13/15(a), p. 578/565 (I don't like the way the author's solution machine looks in the back of the book!)
Definition: Finite-State Machine Recognition A finite-state machine M with input alphabet I recognizes a subset S of (the set of finite-length strings over the input alphabet I) if M, beginning in state and processing an input string , ends in a final state (a state with output 1) if and only if .
Practice 40, p. 565/550
Notes:
What kinds of input can a finite-state machine recognize? Regular expressions. Regular expressions over I are defined recursively by
Kleene's Theorem assures us that a finite-state machine can recognize a set S of input strings if and only if the set S is a regular set (that is, a set represented by a regular expression).
Since some very reasonable sets are not regular (e.g. , where stands for n copies of a), finite-state machines are obviously not sufficient to understand all of computation.
Examples of regular sets given by regular expressions:
Exercise 17/19(e), p. 579/566 - recognition and minimization motivation
One obvious way in which a machine can be minimized is if there is an unreachable state: if so, then that state can certainly be trimmed from the machine without any consequences (from the standpoint of output). For example: Table 8.3, p. 568/552; and Figure 8.7, p. 568/553.
Practice 43, p. 568/553
It would be nice if we had some general way of minimizing a machine, however. It turns out that we can find a minimized machine by using the idea of equivalent states. The idea is that several redundant states might operate in such confusing fashion that it appears there's lots going on, when there's not!
In the first step, the unreachable states are removed. That's the easy part! Then we define
Equivalent States: two states and of M are equivalent if, for any , where by the awful notation we mean the sequence of output which occurs given that we start in state s and receive input .
(There is no way that our author should have used notation which seems to imply that is somehow both a function from and a function from , except that she's proving herself a computer scientist and an object-oriented one at that, and overloading the function ...).
In order to find equivalent states, we define the notion of k-equivalency: two states are k-equivalent if the machine matches output on an input of k symbols to the two states.
Best to look at an example!
Exercise 34/41, p. 584
The set of states is divided up into subsets of the initial set which have for
their union the entire set S, and no common intersections. This is called a
partition of the set S. As we progress from 0-equivalency on up, each
subset can be divided, but none ever coalesce. There can be partition
refinement (finer partition) only.