+1 (208) 254-6996 [email protected]
  

State diagram for a lo ck

with combination 0·5·2

Don't use plagiarized sources. Get Your Custom Essay on
State diagram for a lo ck with combination 0·5·2 finite-state machine c ould recognize a mor e complicated pat­ tern, such as a misspel led word within a stre am of text.
Just from $13/Page
Order Essay

finite-state machine c ould recognize a mor

e complicated pat­

tern, such as a misspel led word within a stre

am of text.

As powerful as they are , finite-state mac

hines are not

capable of recognizing all types of patterns i

n a sequence. For

instance, it is imposs ible to build a finite-

state machine that

will unlock a lock w henever you enter an

y palindrome-a

sequence that is th e same forward an

d b ackward , like

3-2-1-1-2-3. This is because palin

dromes can be of an y

length, and to recogn ize the second half of

a palindrome you

need to remember e very character in the

first half. Since

there are infinitely m any possible first h a

lves, this would

require a machine wit h an infinite number

of states.

A similar argument demonstrates the im

possibility of

building a finite-state m ach ine that recognize

s whether a given

English sentence is gra mmatically correct. Co

nsider the sim·

FIGURE 16

State diagram to recognize sequences like 1,0,3 and 1,0,0,0,,

UNIVERSAL BUILDING BLOCKS 37

A’T:lre

A 1. lOGKEl> )

0

j ..fl’l’trll/K6

l” 1 e,ur A i�A&

/.ooK/lo/ft \ Ft:11(.

i3

8 ple sentence “Dogs bite.” The meaning of this sentence can be

changed by putting a qualifier between the noun and the verb;

for instance, “Dogs that people annoy bite.” This sentence can

in turn be modified by putting another phrase in the middle:

“Dogs that people with dogs annoy bite.” Although the mean­

ing of such sentences might be expressed more clearly, and

although they become increasingly difficult to understand,

they are grammatically correct. In principle, this process of

nesting phrases inside of one another can go on forever, pro­

ducing absurd sentences like “Dogs that dogs that dogs that

dogs annoy ate bit bite.” Recognizing such a sentence as gram­

matically correct is impossible for a finite-state machine, and

for exactly the same reason it’s difficult for a person: you need

a lot of memory to keep track of all those dogs. The fact that

human beings seem to have trouble with the same kinds of

sentences that stump finite-state machines has caused some

people to speculate that we may have something like a finite­

state machine inside our head for understanding language. As

you will see in the next chapter, there are other types of com­

puting devices that seem to fit even more naturally with the

recursive structure of human grammar.

 

 

38 THE PATTERN ON THE STONE

I was introduced to finite-state machines by my mentor Marvin Minsky. He presented me with the following famous puzzle, called the firing squad problem: You are a general in charge of an extremely long line of soldiers in a firing squad. The line is too long for you to shout the order to “fire,” and so you must give your order to the first soldier in the line, and ask him to repeat to the next soldier and so on. The hard part is that all the soldiers in the line are supposed to fire at the same time. There is a constant drumbeat in the background; however, you can’t even specify that the men should all fire after a certain number of beats, because you don’t know how many soldiers are in the line. The problem is to get the entire line to fire simultaneously; you can solve it by issuing a com­ plex set of orders which tells each soldier what to say to the soldiers on either side of him. In this problem, the soldiers are equivalent to a line of finite-state machines with each machine advancing its state by the same clock (the drumbeat), and each receiving input from the output of its immediate neighbors. The problem is therefore to design a line of identi­ cal finite-state machines that will produce the “fire” output at the same time in response to a command supplied at one end. (The finite-state machines at either end of the line are allowed to be different from the others.) I won’t spoil the puzzle by giv­ ing away the solution, but it can be solved using finite-state machines that have only a few states.

Before showing you how Boolean logic and finite-state machines are combined to produce a computer, I’ll skip ahead in this bottom-up description and tell you where we’re going. The next chapter starts by setting out one of the highest levels of abstraction in the function of a computer, which is also the level at which most programmers interact with the machine.

 

 

CHAPTER 4

Order your essay today and save 10% with the discount code ESSAYHELP