Skip to main content
Logo image

Applied Discrete Structures

Section 14.4 The Monoid of a Finite-State Machine

In this section, we will see how every finite-state machine has a monoid associated with it. For any finite-state machine, the elements of its associated monoid correspond to certain input sequences. Because only a finite number of combinations of states and inputs is possible for a finite-state machine there is only a finite number of input sequences that summarize the machine. This idea is illustrated best with a few examples.
Consider the parity checker. The following table summarizes the effect on the parity checker of strings in B1 and B2. The row labeled “Even” contains the final state and final output as a result of each input string in B1 and B2 when the machine starts in the even state. Similarly, the row labeled “Odd” contains the same information for input sequences when the machine starts in the odd state.
 Input String0100011011 Even( Even,0)( Odd,1)( Even,0)( Odd,1)( Odd,1)( Even,0) Odd( Odd,1)( Even,1)( Odd,1)( Even,1)( Even,0)( Odd,1) Same Effect as0110
Note how, as indicated in the last row, the strings in B2 have the same effect as certain strings in B1. For this reason, we can summarize the machine in terms of how it is affected by strings of length 1. The actual monoid that we will now describe consists of a set of functions, and the operation on the functions will be based on the concatenation operation.
Let T0 be the final effect (state and output) on the parity checker of the input 0. Similarly, T1 is defined as the final effect on the parity checker of the input 1. More precisely,
T0( even)=( even,0)andT0( odd)=( odd,1),
while
T1( even)=( odd,1)andT1( odd)=( even,0).
In general, we define the operation on a set of such functions as follows: if s, t are input sequences and Ts and Tt, are functions as above, then TsTt=Tst, that is, the result of the function that summarizes the effect on the machine by the concatenation of s with t. Since, for example, 01 has the same effect on the parity checker as 1, T0T1=T01=T1. We don’t stop our calculation at T01 because we want to use the shortest string of inputs to describe the final result. A complete table for the monoid of the parity checker is T0T1T0T1T0T1T1T0
What is the identity of this monoid? The monoid of the parity checker is isomorphic to the monoid [Z2;+2].
This operation may remind you of the composition operation on functions, but there are two principal differences. The domain of Ts is not the codomain of Tt and the functions are read from left to right unlike in composition, where they are normally read from right to left.
You may have noticed that the output of the parity checker echoes the state of the machine and that we could have looked only at the effect on the machine as the final state. The following example has the same property, hence we will only consider the final state.

Example 14.4.1.

The transition diagram for the machine that recognizes strings in B that have no consecutive 1’s appears in Figure 14.4.2. Note how it is similar to the graph in Figure 9.1.4. Only a “reject state” has been added, for the case when an input of 1 occurs while in State a. We construct a similar table to the one in the previous example to study the effect of certain strings on this machine. This time, we must include strings of length 3 before we recognize that no “new effects” can be found.
No Consecutive Ones Monoid
Figure 14.4.2. No Consecutive Ones Monoid
 Inputs0100011011000001010011100101110111sbababrbabrbarrabrbarrbabrrrrrbbababrbabrbarrrrrrrrrrrrrrrrr Same as00010111011111
The following table summarizes how combinations of the strings 0,1,01,10, and 11 affect this machine.
T0T1T01T10T11T0T1T01T10T11T0T1T01T10T11T10T11T1T11T11T0T11T01T11T11T10T1T1T10T11T11T11T11T11T11
All the results in this table can be obtained using the previous table. For example,
T10T01=T1001=T100T1=T10T1=T101=T1 andT01T01=T0101=T010T1=T0T1=T01
Note that none of the elements that we have listed in this table serves as the identity for our operation. This problem can always be remedied by including the function that corresponds to the input of the null string, Tλ. Since the null string is the identity for concatenation of strings, TsTλ=TλTs=Ts for all input strings s.

Example 14.4.3. The Unit-time Delay Machine.

A finite-state machine called the unit-time delay machine does not echo its current state, but prints its previous state. For this reason, when we find the monoid of the unit-time delay machine, we must consider both state and output. The transition diagram of this machine appears in Figure 14.4.4.
Unit time delay graph
Figure 14.4.4.
 Input0100 01  10 11100 or000 101 or001110 or101111 or01101 Same as(0,0)(1,0)(0,0)(1,0)(0,1)(1,1)(0,0)(1,0)(0,1)(1,1)(0,1)(1,1)(0,0)(1,0)(0,1)(1,1)(0,0)(1,0)(0,1)(1,1)00011011
Again, since no new outcomes were obtained from strings of length 3, only strings of length 2 or less contribute to the monoid of the machine. The table for the strings of positive length shows that we must add Tλ to obtain a monoid.
T0T1T00T01T10T11T0T1T00T01T10T11T00T01T00T01T10T11T10T11T00T01T10T11T00T01T00T01T10T11T10T11T00T01T10T11T00T01T00T01T10T11T10T11T00T01T10T11.

Exercises Exercises

1.

For each of the transition diagrams in Figure 5, write out tables for their associated monoids. Identify the identity in terms of a string of positive length, if possible.
Exercise 1 of section 14.4
Figure 14.4.5. Exercise 1
Hint.
Where the output echoes the current state, the output can be ignored.
Answer.
  1.  Input Stringabcaaabac1(a,1)(a,2)(c,3)(a,1)(a,2)(c,3)2(a,2)(a,1)(c,3)(a,2)(a,1)(c,3)3(c,3)(c,3)(c,3)(c,3)(c,3)(c,3)  Input Stringbabbbccacbcc1(a,2)(a,1)(c,3)(c,3)(c,3)(c,3)2(a,1)(a,2)(c,3)(c,3)(c,3)(c,3)3(c,3)(c,3)(c,3)(c,3)(c,3)(c,3)
    We can see that TaTa=T \textit{aa}=Ta, TaTb=T \textit{ab}=Tb, etc. Therefore, we have the following monoid:
    TaTbTbTaTbTcTaTbTcTbTaTcTcTcTc
    Notice that Ta is the identity of this monoid.
  2. Input String1211122122ACBADDABDABCCBCADCBBCDBCDAAD
    Input String111112121122211212221222ACBBCBCCBBDAADADDACBCCBCBBCDBCCBCBBC
    We have the following monoid:
    T1T2T11T12T1T2T11T12T11T12T1T2TbT11T2T1T1T2T11T12T2T1T12T11
    Notice that T11 is the identity of this monoid.

2.

What common monoids are isomorphic to the monoids obtained in the previous exercise?

3.

Can two finite-state machines with nonisomorphic transition diagrams have isomorphic monoids?
Answer.
Yes, just consider the unit time delay machine of Figure 14.4.4. Its monoid is described by the table at the end of Section 14.4 where the Tλ row and Tλ column are omitted. Next consider the machine in Figure 14.5.7. The monoid of this machine is:
TλT0T1T00T01T10T11TλTλT0T1T00T01T10T11T0T0T00T01T00T01T10T11T1T1T10T11T00T01T10T11T00T00T00T01T00T01T10T11T01T01T10T11T00T01T10T11T10T10T00T01T00T01T10T11T11T11T10T11T00T01T10T11
Hence both of these machines have the same monoid, however, their transition diagrams are nonisomorphic since the first has two vertices and the second has seven.
You have attempted 1 of 1 activities on this page.