Download as pdf
Download as pdf
You are on page 1of 28
COMPUTATION: FINITE AND INFINITE MACHINES MARVIN L. MINSKY 7 Professor of Elecirical Engineering Massochusents Institue of Technology (964 PRENTICE-HALL, INC. ENGtEWoOR EHTS. N COMPUTABILITY, EFFECTIVE PROCEDURES, 5 AND ALGORITHMS. INFINITE MACHINES. 5.0 INTRODUCTION We now tar to some busie questions centered sound the very notinn of a mechanical process. Whal can a machine do? Whit does i mean to say that a process is mechanical? When 1s. procedure 50 completely specified that a machine ean carty it out? In earlier chapters ‘we explored the limitations of machines with finite memory. Whit hap- Pens when we lift this restriction? What problems can be solved by machines - by mechanical processes with unlimited memory? Are there processes that can be precisely described yet sill cannot be realized in 8 machine? As we noted in chapter 1, most people have a low opinion of the intellectual potentialities of machines. It is usually felt tha: although machines can be very fast, of very strong, they cannot be very smatt.It is well known that machines have been made to do many things thal meet high human standards to play games very well. to find solutions 10 ‘mathematical problems of college-grade difficulty. 10 find solutions i i= ficul systems design problems. ta classify viswal patterns of appreciable complexity, Blut itis asually felt thal this reflects ne credit on the machine that because the designer or programmer has set down every small ail of the process, the machine has only te perform (however quickly ') simp: clerical tasks Wis certaimly true thot programming the job of specifying the pre: cedure that a computer is to extty oul amounts to determining in ade vance eweytning the compurer will do. In this sense, a computer’ Progcam can serve asa precise description of the prceess the machine will 4 and acew 103 Loea7 TOL conmerann any west catry ot. and in this same sense itis 1m ngful to say thik anvrhing that ‘ar he dove bv a vorputer can he precisely described. We often hear « kind of converse statement to the eTect that “anv procedure which car be precisely deveribed can he prograrmed ta he per: formed bva computer.” 1 have heard this and similae statements made on many oecasicns. and the proposition is usually stated to be a consequence ‘ofthe work of the mathematician Alin M. Turing. But tis not usually sled exactly what is that Turing proved: in particular it is not made clear what was his nntion of “precisely described.” Turing's concept of a precise description of a process is essential to the following chapters, so. wehave to explain tin some detail 5.1 THE NOTION OF EFFECTIVE PROCEDURE Our exploration of machines in Part I is based, in large part, on ideas. derived from the paper of Turin2 [1936] on the theory of computability ‘This paper is significant no! only for the mathematizal theory which can- cerns us here, but also because it contains, in essence, the invention of the modem computer and some of the programming lechniques. that accompanied it, While it is oftey said that the 1936 saper did not really much affect the pravvical development of the computer, Lcould nat agree to this m advance cf a careful study of the intellectual history of the mater Turing’s paper must be viewed against the intellzctual background of a variety of idews concerning descriptions and procestes, Again we think of acollectior af questions. Whar processes can be descrited? Surely the notion of deseriptiny entails some language, Could any one fired lan- fuze admit description of all describable processes? Can there be prce- cesses which are, somchow, well defined, yet caro: be described at all? Would be argued that there might exist definite processes. whose com: ‘Mmunication requites the transmission of a mental attitude, or a disposi- tion, which cannot he cap-ured in any finite number of words which must remain in itive “ei important me tht ths does nO PAN thal the person who writes a comple Proptam autematcaly ut lesan al he conecquenes of what fe as de! Tt perfectly Poste to wite imitans whieh Tauneh the computer sate a prea sevteh process, wah sanyo the alate fests of ean evouon, a the eansegren developmen feanbly experiment st to sce what wall Ye the Behar of a speed system not wall enough to that the hs ation does mol mean smwmedte jes or phases, is mo ‘he solutions ad thi entail some Kind of process called sre SI cawrutaminy 105 Such questions had concerned mathemaricians for some time before the advent of computing machines, These questions axe associated with the idea of an algorithm —an effective procedure’ for calculating the value of some quantity or for finding the solution of some mathematical problem, ‘The idea of an algorithm or effective procedure arises whenever we are presented with a set of instructions about how to behave, This happens. when, in the course of working on a problem, we discover that a certain procedure, ifproperly carried out, willend up giving us the answer. Once ‘we make such a discovery, the task of finding the sclution is reduced from a mailer of intellectual discovery to a mere matter of effort; of carrying. ‘ut the discovered procedure—obeying the specified instructions. But how does one tell, given what appears to be # set of instructions, that we really have been told exactly what todo? How can webe sure that ‘ve can henceforth effectively act, in accord with the “rules,” ‘without ever having to make any further choice or innovation of our own? ‘This question is easily answered if the process is supposed to terminate ina certain finite, already known, time, because then we can just try it and see, Bul ifthe length of the proces isnt hnown in advance, then “Irying it may not be devsive, because ifthe process does go on forzver then at ‘no time will we eve” be sure ofthe answer, Our concein here is not with the {Question of whether a process terminates with a correct answer, or even fever stops. Our concern is whether the rent step is always cleatly deter: ‘mined, The other questions will come up in chapte: 8. Tre position we will akeis this: Ifthe procedure can be cerried out by some very simple machine, so that there can be no question of or need for “innovation” of “intelligence,” then we can be sure that the specification is complete and thal -ve have an “effective procedure” We expect no quarrel with this, But we will also maintai sort of con: ‘verse, which will seem at first We assert that any pro- cedure which could “naturally be called effzctive, can in fact be realized by a {simple} machire, Although this may seem extrerne, the arguments below in its fivor are hard to refute. ‘We must emphasize thal this is a subjective matter, for which only argument and persuasion are appropriate; there i novhing here we can expect to prove, Itisnnt necessary to accept (or even to reed) the follow: ing a'guments, to appreciate the mathematical development of the sequel The teader who finds himself in strong disagreement either intellectually ‘or (more likely) emotionally should nat fel that keep him {rom apprecia tion of the beautiful technical content of the theory developed further on. ‘We will usethe later erm inthe sequel. The terme are roughly synorymous. bot there rea tamer shades of mening weed in dierent contest, exfecaly for sigh.” 105 covneannry se Sa 5.1.1 Requirements fora definition of lective procedure In irying to give precise mathematical cefinition to “elective pro- cedure.” one encounte's various diffieulies, (One cannot expect always, tofind a simple sind completely savisfactory formal equ valent for 2 com. plex intuitive notion.) We ill hegin by saying that an elfective procedure is a set of rules which tell Us. from moment to moment, precisely how to behave This attempt ai: definition is subject to the evticim that the interpreta: sion oF the rules is left to denend on some person oragen!. Now a person's ability to obey iestructions denents om his back , ens on his hickerourd and intell gence Wis inetigence ve tor smal, he ay “al Yo understand what we mean Whisimeltigence is wo lar. or ton alien, he riay invent some cowsistent imerpretation ef the rules that was not intended. We know how often am ambiguity, | We could avoid the problems of interpretation. of understanding —if ‘e could specify, along with the statement of the rules, the details of the mechanism that is to imerpret them This would leave no ambiguity. OF course, it would he very cumbersome to have to do all this over again for each individual procedure; itis desirable to find some ceasonably wriform rmily of rule-obeying mechanisms, A most convenient formulation would be one in which we set up (1) language i4 which sets of behavioral rules re to be expressed, and (2) single mochine whieh can interpret state- ‘ments in the Linguoge and thus eatry out the steps of each specilied process. This sugeests designing some scrt of machine to accept seis of rules, eapressed in some linguage, and te do what the rules require. Hete one might expect «new difficulty. For surely one would not expect any single mechanism io he powerlul enough to interpret and execute rules for all oective procedures. Surely one would expect to need at least a sequence of moresane-more complex machines fer the execution of a sequence of more-anal-nare compiles procedures Curiously, tis is no problem! I curns out that we can realize our notion of ar instructior-obeving machine in a form which remains con- stant, ne matter how comples the procedure in question. That is, we can set up a rubss-tanpuge and a single “universal” interpretation machine Shieh can hancle aif efective procedures. The detailed construction is se 32 rosenrsnintey 107 found in chapter 8; the trick is tw substitute merely quartitive increases in merrory sive for qualitative increases in complenity of the machine Although we state this as fact, there remains a subjective aspect 0 the matter, Different people may not agree on whether a certain procedure shoulc be called effective, Perhaps there are processes. one might sup- pose, which simply cannct be described in any formal language, but which can nevertheless be carried out, e., by minds. One might even argue that those important, but still mysterious, functions which make minds superior to all cresently known mechanical processes must, by their intuitive nature, escape amy systematic description. ‘Turing discusses some of these issues in his brilliant article, ““Comput- ing Machines and Intelligence” {1950}, and 1 will not recapitulate his arguments. They amount, in my view, 1¢a satisfactory refutation of many such abjections, We will put aside such matters and turn firsi to the prob- em of making precise the intuitive idea of obeying a set of instructions. Matters are clarified by confining attention first to very conciete processes, such as the execution of mathematical computations. $2 TURING’S ANALYSIS OF COMPUTATION PROCESSES this 1936 paper, A. M. Turing defined the class of abstract mi that now bear his name. A Turing machine is a finite-state machine ass0. ciated with a special kind of environment —its tape—in which it can store (and later recover) sequences of symbols, Wewill describe these machines in greater detail in chapter 6 and the sequel. They are very simple. At each moment the (finite-state part of th:) machine gets its input stimulus by reading the symbol writien at @ certain point along the tape. The response of the machine may change thet symbol and abo move the ma- chine a small distance either way along the tape. The result is that the simsrus for the next cycle of operation will come from a different “square” of the tape, and the machine may thus read a symbol that was “written there long ago. This means that the machine has access to 1 kind of rudimentary exterior memory in addition to that provided within its finite-state part. And since we will place no limit on the amount of ta available, this memory has, in effect, an infinite capacity. But the re- stricted manner in which the machine and its tape are coupled (see chap {cr 6) might make one think, at first, that the possible ces af this poten tially infinite mernory would be really very limited “Turing discovered, however. that he could set these machines up to make very complex compute ters Gand T we will work out a number of examples and see that the tape memory really does escape the limitations of the finite-state machine 198 comenantniry 5a Turing goes on to defend the Following proposition, now often calle Turine's the sis Any process which could naturally he called an eMfective nrovedure cin be realized hy a Turing machine, This proposition, in its most general form, is usually celled Church» {neti aller the work of Abonco Church telating the int tive notion of ef fectiveress to formal logical processes, We refer to il a8 Turing's thesis because of our preoecupation. in the secvel, vith Turing’ partie formatition of compatabiity concepts Part of Turing’s 1936 paper ts gamecined with demonstraing the equivalence of his and Checks orior When une sees how primitive the machines really are, in concept, this thesis seems incredibly rash, Yet the years have borne out Turing's view Every procedure which mathematicians have generally agreed to be “effective has been shown equivalent, in one way or another. to a pron cedure carried out by a Turing machine. One cannot expect prove Turing’s thesis, since the term “naturally” relates rather to human dispositions than (0 aay precisely defined quality of a process. Support must come from intuitive arguments, ard we could hardly do heiter than te present some of the erguments in Toring's own, words, 5.3 TURING'S ARGUMENT The following is taken verbatim from Turing [1936, section 9]. tt is cone of a sequence of arguments in Tavor of his position. ‘The other argu. ments are reviewed clesrly in Kleene |1952]. The machines discussed in {he quotation are essentially those described in the next chapter today called “Turing machines.” Note that the word “computer” as ased in the quotation means the person that Turing is going to teplace by a machine ‘Computing normally done by writing certain symbol on paper. We may suprose ths paper is divided into. aquaes tke 9 child's eta book. In lementary arithmetic the two dimensional lananes of ta ane is sometimes uted. Bat socha uss i always avoidable, and tok erie willbe sered thatthe two-d mensional character of paper ie ne assent of computation. 1 assume tha thatthe computation i corded oat og one Simensinal paper... omatepe divided into squats, I shall ave sane that the numberof smote which my be printed nite Hi oe ae ts Hoa an infinity of snl, then there woud he spmbutsdifring eae subitearily small extent” The elect af this Fest atinn ol them Symbols i not very serous {tw alive potable tv ase squemes sm bots inthe place of single symbols, Thos an Arabic mumeral such as 1 ot '999999999999909 is normally treated as a single symbol. Similarly in any European language words are treated as single symbols (Chinese, however. attempts to have an ensmerable infty of symbo's). The differences from ‘ur point of view between the single and compound symbols is tat the com- ound symbols, if they ate too lengthy. cannot be observed at one glance. This is im accordance with experience. We cennot tell ata glance whether '9299999999996099 and 999099089990009 are the same, “The behasiour of the computer at any moment is determined by the sombck which he isobserving, and his ‘state of mind! at that moment. We ‘may suppose that there isa bound B 10 the number of symbols or squares which the computer can abserve at one moment. If he wishes to observe ‘more, ke must use successive observations. We will also suppose that the ‘number of states of mind which need be taken into account is finite The feasons for thisare ofthe sme character as those which restrict the number ofsymbols. If we admilted an ifinity of states of mind, some of them will betartitearily close” and will be confused." Again, the restriction is nat one which seriously affects computation, since the se ¢! more complicated states ‘of mind ean be avoided by writing moce symbols om the tape “Lel us imagine the operations performed by she computer to be split Lup into ‘simple operations’ which are so elementary that it is not easy to imagine them further divided. Every such opetation consists of some change ‘of the physical system corsisting of the computer and his tape. We know the state of the sysiem if we know tke sequence af symbols on the tape, which ofthese are observed by the computer (possibly with a special order), And the state of mind of the computer. We may suppose that in a simple ‘operation not more thar one symbol is altered. Any other changes can be split up into simple changes of this kind, The siluation in regard 0 the squares whose symbols may be aliered in this way isthe same as in regard to the observed squares. We may, therefore, without loss of generality. assume thatthe squares whose symbols are cha ged are always observed’ squares, ‘Woe regard» symbol as Reralyprntedom aque we may suppose thatthe square is Dc ect 0 e421 Theiymtot dened acto pon i thc ser. vt hese cecupied by pine’ ink IF thee stat ered ta he mexrabe. we cin debe the “Ssiance between two symbo's ae he on of taesonming one mol vot oer Ie cest of moving aunt atenof printer ink ant tance & uniy, ad there a8 inte Suply of es = 2a = 6" Wal he tcp the symbol form a conditionally om ef spice [Tongs note insnesscrd arin, we cool enderstard wha rag cout! Pave meat he somgetion that “sites nf mind” could he "confused" f he & dacusang. pyetolgicl ‘nites. Tine e basin mind physi! sates of bri, then one would red tepect hat for sulfite silo saves thers wil be x shanceof ander transitions. ef Decse of themator quintam prenvncna ‘Tete ai to ine amount of ifermaton fat con ne recovered fom any physical sem of lied sie. "The same held for whlever hss tem ie wed In reeset he syle mithin the “squavex™ of fied dimen, ist No comm raninaey sh Asides thee hanes. symboh, the Simple operations must changes of distribution of observed squc ‘ene pant Then oheesed oars ms heummedtely restart Py the sompater Tahini reason Spon that hey amon hesquateswtce asta fm he Cet te inmedtcle previa sheers square Goce ol exceed ert fred mount Het uv say thi cach ofthe new served squares i within strc smi ei shan ae jr emaclnn sith "immediate copia. it may be thought hat there te ciher Kinds ayeares witch ate immediatly resemble. In arn gute ne by sp sate mh he heh me ym. Nowe ess mh ayy ne ym theory hy adjoining these marked squares to the observed rai Ion ihrer hate nae asquace mb wens fpr thepreetvotteepiten an sete proces This fe foneamena fo Sd shoald bevel. te mont mania papers the eqoatons ted tren ranted Noval te mur nt za tyond (on) yo eshte, pose wo rcpt n tren ats ln Bye amber But ifthe paper wat wey longa we mht reach Ther ISriamaMes7t ten Trier on inthe pe 8e ih Hd heme Cspniyng Taeorem 197307 NAST) we have," Inonder to make sre which sis he eleva theorem we hauldhave o compare the lwo nuabes igure y toe. posy byte pee make sen their at ey cone twice inspite of tht i Thought hit hve evar “ones teonpn sie square, does mt pct my Cone thon sotong aeihesesqunresca he found he some nowes ef hich My of machine is capable, ™ Medes “The simple operations must therefore include 1a) Changes af the symbol on one of the observed wanes (hy Changesaf one nf the squares observed to another fxeate within ftir of one ofthe presoush observed squires. " i may he that some of these changes necessarily involve a change of tw he one of the falhow ing: ween (0 A psi change (0) of smo tgeter wih poss ble change of state of mind. " (3) A pms case th of served sears DC “The operation ately petonmed is determined a ha he Ihve ye i mnt he opin he symbol In “operation. ” a We may now comstruet 2 machine to bo the werk “Tocach cute of mind of the compater cartespends an “mrcunigatin ol the machine. The machine seans squares correspording to the # squares hverved by the computer. In way move the machine can change a symbst ar scanned square i ean change any one of the scanned squares to Sher square distnt ret morethan L squares from one of the other scanned Squares’ The move which is done, and the swcceeding configuration, ae Getermined by the seanned symbol and the m-configuration. ‘The machines fet described do not differ very essemtialy from computirg. mechines 3s Hetined (rreviously} and corresponding to any machine of this tye a com fputing muchine ean be constractes to commute the sare sequence, that is (0 fay the sequencecomputed by the compute 5.3.1 The equivalence of many intuitive formulations Perhaps the strangest argument in favor of Turing’s thesis is the fact that, over the years, all other noteworthy altempts to pive precise yet intuitively satisfactory definitions of “effective procedure” have turned tout to be equivalent. to define essentially the same class 07 processes. In the 1936 paper Turing proves that his “computability” isequivatent to the Neffective calculability” of A. Church, A very different formatation of effectiveness, described at about the same time by Emil Post, also turned Gut to fave the same effect: we show the equivalence of Post's “canoneal Gyieme" and Turing machines in chapter 14, Another quite different formulation, that of "general recursive function” due to S.C. Kleene and others s alsoequivalent. as weshow in chapters 1Oand 11. More recently a inumter cf atheé formulations hase appeared, with the same resull (6.8. Smullyan's “Elementary Formal Systems” (1962). Whenever a system hae been proposed which is net equivalent to these. its deficiencies or ex: cesses have always been intuitively evident Why is this an argument in favor of Turing’s thesis? It reassures us that diferent workers with different approaches probably did really have the-same intaitive concept in mind--and hence leads us to sappose that there i really here an “objective” or ““sbsclute” notion, As Rogers [1959} pot it “tn this sense, the notion of effectively com- putahe function is one of the few “absolute” con- Pints produced by modern work in the founda tions of mathem: Proof of the equivalence of two oF more delinitions always tas a com: pulling effect when the delinitions arise frarh different experiences and motivations + pe we dhl see, rere fe no Wes of paesity fe reatnet oh and 8 to Be unity MM 12 coun ramniny ssa 54 PLAN OF PART it This second part af the hwok explores the properties of our extended machines finite-state machines with a possive hut unlimited environment of serateh paper.” This exploration continues ty develop the two themes ofthe ltst part of the hook. We try to assess the range of possible be: haviors “fo characterize what is within and outside the “each of ikese machines. And we continue to exercise our avocation - the collection of very small “universal bases” for the sssembly of structures which realire the full rarge of behavior in both these avenues we now meet 1 much more extensive,and ex: cilire range of phenomens. One would certainly expect the range to be lores. since we have argued that our new machines ean encompass all effective procedures, For our hubby, we discover some remarkable bases, The reader will find it incredible, at first sight, that seme of these sets of simple operations couid give rise to the full range of possible comput iors Tor the more serious objective that of characterizing the effective mrecedures’ we acquire 3 remarkable twol, the miversal computing makine, (urns out (n chapter 7) that there exists a certain Turing ma imitate the behavior of any other Turing machine, given an adequate description of the structure of that other machine, (The intion is te be written down in the environmen! tape and reed not he built inty the works of L4€ universal machine) Asa result, our expluration can be reduced to the study of this single machine. While we do not entitely se restrict our attention, we do frequently eall upon the evidence of such a machine throughout the sequel. The universal machine also opens the road toward simple buses, The universal machine works. as one might expect, by operating on the dteseiption of sother machine. Wimterprets such a description, one step ata time, > that, in effect, it imitates the other's behavion, With “i {erpretative behuivioe” within the scope of our muchines, we can bepin vo ask new kinds of questions uhou: machines, For instance, one can ask What happens when a machine is confronted sith its own description? I his is done t the universal machine, then, as one mighl expect. the machine must hecome paralyzed by an infinite regtession cf interpreta: toncyeles it eon never actually get to compute anything, At first, such ‘aining, then annoying, and finally we are forced {0 conclude that they signal partentous absiacle te our exploration. Fe find that certain vf the questions we naturally ask about machines cannot he answered, at least by any effective procedure for answermg questions. In. Adecd, the nfost senificant results of the second part of the hook are nega We results indicating limitations not only on the effzctive procedures chive whi ca phenomena seem eit | see sa commerannnny 13 themselves, but also on our ultimate ability ever io characterize, effec: ‘ively, which procedures are in fact effeciive Chapter 8 contains the beginnings of these results. The basic method K simple and rather stricing, Because the machines are capable of inter, pretetive operation, we can imagine passing certain of our questions one {p the machines themselves. Such a question, for example, ws: Which ma, Shi commutation; eventeally terminate with a definite result. and which go arforever without any definite conclusion? We show. by some simple tec sical tricks, that assuming the existence of a machine that can answer thie ‘uestion leads to a contradiction; herce, no such machine cam exist The non-existence of a certain kind of machine might not be. in itself, agrcat disaster. But so far as our goals here are concerned, this result ¢ indeed very serious: no Turing machine can answer this question. Bue then. if we accept Turing’s thesis, there can be no effective way at all to shrwer it. That is, we can never aspire to-a complete, systematic theory of Pe gantltions under which a compuiation is sure to terminate. We may be able to decide, for one reason or another, that certain machines wid work, and that certain otters will not, but we will never be able to pul this arin. systematic basis which will work for all machines! I repard this, and similar ocher “undecidatility” results, (o be among the most sig. nifcant intellectual discoveries of modern times, One can reject its im Plications only by rejecting Turing’s thesis, but there is no. apperem Prospect of any salisfactory replacement, With the demonstration of these elementary undecidability results, Several new lines of exploration are opened (even if the most desirable line i thus itrevoesbly closed). We could try (0 restrict our machines so chat Uieie behavior is not quite so complicated; and we do this briefly in chapter 10, in connection with the so-called “primitive-ecursive fone tions.” Another line (that we do nor follow) is to study, as if by defoult, the interrelations between various kinds of unsolvability results: “his forms much of the subject matter of the modein mathemalical "theory of sreataive functions.” Our main activity will be to examine a variety of alternative formulations of effectiveness and through this to try to under, Stard something of the sources of wha! we know is @ hope esly complen fante 0’ behavior. In the course of this we will come to understand betee the ‘elation between the modern computer (and ils programs) om the ene hand and these abstract smachines (and theit desc iptions) om the other Chapter 11 is concerned with finding a nmddle ground between’ the Simple bu: impractically inefficent Turing machine, and the more cons Pliccted bat aprlication-oriented modern Computer. Our result ia new ‘ly of abstract machines called “program machines” which com. bine attractive features from borh extremes. It turns out that in almmeet S¥EFE respect program machines are superior to Turing machines for 1 commuranany He $8 theoretical aurpuses; and, by studying them, ve sso abtain some prac lical insight botl into the theory of effective computation and into the hasis of modern computer programming. We do rot wish to arouse wild Fhapes that this theary, by sem: anyone directly with practical computer programming problems. Bur it does provide some of the “cul-ural background” frem which a sitisfactory theory of practical computation will ultimately spring, Chapter, optional and somewhat more advarced than the rest, dis- cusses some conrectiors between the Iheory cf effective procedures and he theery cf rei numbers. cel insight, will 5.5. WHY STUDY INFINITE MACHINES? Up to this paint, our study of machines has been Sased entirely on the finite-state paint of view, We have used quite a few different argu: ments to justify this emphasis; even Turing’s arguments earlier in this chapter are so ditected.’ In the sequel we will deal with machines of an infinite character; our riachines wil have infinite tapes, oF storage regis: ters of unlimited capacity, Since no such machine could exist (in a finite universe) and (even ifthe universe is infinite) we can never have one, why. should we study their theory" Our answer has paradoxical quality. We shall rot give the easy answer that, just as mathematicians study infinite numbers they cannot reach, itis instructive to study the limiting. incecessible extension of our ideas about machines. On the contrary. we take the pesition that this ex- tension is actually needed to pain any rzully practical insight into real-life Enmputers! ICis worth some discussion to see how the infinite-machine theory could he more realistic than the finite theory, for practical pur poses. In the first place, the limitations already established for finite-state machines seem mach toy rec rictive to lake seriously. Our intuitive ideas shout machines require more comprehensive framewark, We ought to he able to tk ahout machines which ean multiply pairs of arbitrarily Large numbers (shown in cha ster 2 to be beyond any finite-state machine) ore the grammatical correctness of arbitrary expressions in the Simplest of mathematical Linzuages. (The argumenis of chapter 4 showed that this ennnot he done by finite-state piachines.) To be sure. We will always he cunfined, in real life, to: machines which erefinite. Rut | assert hat a is no, always the finiteness of the machines. that limits their uses; more eswally it is either (I) the practical limitations ion fom Ting [19% is, te my knowledge, the fret clear deseipcion se 85 Fowpuraniiaty 1) of sunning-time or (2) the conceptual complexity of their structures “programs.” Thus, we know that ro finite machine can enumerate & the integers: it cannot count. in any reasonable sense, past its number ¢ distinct accessible internal states, But that is not the fimitation met i Practice; even the smallest modern computer has thousands of bis ¢ accessible memory, but for one actually te count up ta 2"°—even opera’ ing at the wave frequency of hard cosmic rays—would take longer eor than even our most cosmological astronomers like to consider. Thi ‘makes suspect the practical guidance value of inferences based solely 0 the finite-state limitation. ‘A more serious practical limitation arises when we consider machine “which consume a large information storage capacity in a relatively passiv ‘way. We might want to consicer, for instance, a mazhine which remerr bers all ofits previous input experience.’ Even here the practical limite tion rarely tabzs the form of an outright bound on machine size; it he instead the peculiar form of relentlessly increasing economic pressun For, given a real machine, we can always extend ita bit more by addin paris (and hence states) in the ‘orm, say. of external storage tapes. Th ‘eventual termination of such growth will depend on more or less itrelevar circumstances surrounding. the project rather than on any particular natural bound on the machine size. For modern computers. we can usually provide enough external men ory for our problems. The computation time still usually remains at th practical limitation. This s aggravated by the fact that access to extern memory (€.8., magnetic tapes) may take millions of times longer tka ‘operations within the central machine! Even if this were not so (and on million times 2%" is sill ke 2", in practice), our difficulty is less ths the machine ends up in e state-diagram loop than that we cannot wa util it does. For such reasons, it would seem profiteble to study the theory of ms chines in which the amourt of machirery is not itself the imitation. Bt it would not be profitable, at least from our point of view, to stady m: chines which ore really infinite either in initial endowment or in effectis speed of operation. Thus, it would seem unrealistic to consider a machin which, when started, already ccntains the correct answers 10 all answe able questions in English! Nor would it seem realistic to study a machin "There ats sone who believe the homan bean bas this cepacity, at am inline Ile that this iedve to a comiinatir of wisful thinking and misinterprtation of sil ing, but excertiona. incidents "There remains afundsmental prablem her, even if acces times for external memo femaimed conan! with inceasng sve. Form the memory sire rows then the length « time, om the weraps forthe commuter lo compute the adress in memory 4 tum rom too, altel mach moreshraly 16 comm anny we, $5 which could test in fine time, an infini'e number of eases oF hypo heses Cind thas ‘ell us whether or not Fermat's Last Theorem is true ty ex ‘amining all cases). A compromise seems inevitable; we must consider fmachines which have at euch moment only a finite quantity of structure, but which are capable of heing exienced indefinitely as time goes om “growing machines.” The Turing machine, with its finite-state computing unit and its nitialy “almost-blank” tape, is perfectly suited to our purposes, We need fot think of the machine's tape as infinice, We imagine instead that the machine begins with a finite tape, but thal, whenever an end is en crumterad. another nit of tape (a “square") is attached ‘Thys, instead of an infinite tape, we need only an inethaustible tepe factory. Since, in fa21 there isa fixed bound on the rate at which new tare can be required cone square per moment is the worst sase—the factory can be ma {ined by investing « fixed, finite amount of money ir a (perfectly) reliable fark. (This picture gives a reassuringly finite picture of the new study Accordingly. although we are done with the study af finite automata, we need not jump directly to the study of infinite automata, Instead we will werk in what Burks [1959] aptly calls the domain of “growing automate.” 6 TURING MACHINES 6.0. INTRODUCTION A Turing machineis a fite-tate machine associated with an externa storage or memory medium. This medium has the form of sequence © Squares, marked off ona tinea tape, The machine Is coupled To “he lap through fea which ssusted at exch momen on some square of ht tape Fig 60-1), Thehead hs tree function, all of which are eeerne inch operation eek ofthe ne wate mane ncn ae reading the square ofthe tape being “scanned,” wring on the scannec Saver, and sing the machine toan adjacent nquare ich hecone th seansed square inthe nextoperation cyte oO 3 Top —— Fe 604 ine is char: twill be recalled from section 2.2 that a finite-state mac acterized by an alphabet Sq) of input symbolé, an aiphabe (Fo... 4) oF output symbols, a set (oy... 4p) of incernal states. and ¢ pair of functions . OU +H = GEM, SO) RU +N = FO. S) 18 VORISG MAC sis se, 60) sich deverite the relation hetwcen put. intermil state, and schsequent felavioe In onder te attach the extereal tape itis convenient to modify this description alte, The nput symbu (ss. sit wll be precisely these that may he incrihed on the tape. one symihol rer squire. The inpat te the machire Mat the time f, wil be just that symbol ranted in the squire the machine‘ scaneing at that moment. The reusing charge i slate wil thea he determined. as sefore. By the func fom G._The ouput of the snachine M fas now the dual function ol (1) r= ine om the scared square (perhaps charging the syrabol already there) {nd Q) moving the rope one wav on the other Thus R. the response, has two compo rents. One component of The nse simply a symbol, from the same set (*9.. +.ta) to be printed am the scanned square; the second component is one or the other of two syrahots°9" (meaning *Mive felt") ard T #°Move right"), which have the Corresponding effect on the machine's position. Accordingly, itis core ‘enient to think ofthe Turing machine as descrited by three funccions tm) will remain che same, Gir + 1) = G(aKH. SI) fur + 1) = FQN. SM) Bins VW = BCG. SU) where the new “unction “DF tells which way the machine will move In eae operation cyels the mach ne starts in come state qi, reads the symbol s,written on the square under the head, prints there the new sy bol Figie5,). moves left or right according to D(q,. 6). ané then enters the new state (( 4.) When a symbol is printed on the tape, the symbol previously there is ciased, OF course, one can preserve it by printing the same symbol that was read. ie., if F(q,, s,) happens to be f). Because the machine can move either way along the tape, it is pessible for it to return 10 a pre viously printed location to recover the information inscribed there, AS we will sce, this makes it possible to vse tre tape for the storage of arbitrarily large amounts of useful irformatinn. We will give exsmples short'y The tape is reparced as infinite in both dicections. But we will make the restriction that when the machine is srarted the tape mast be blank, eceept for some finite nusber of squares With this restriclion one can think of the tare as really finite at any particular time but with the provi= sion, whenever the machine comes 19 in end of the fiite pertion, some fone will attach another square Formal mathematical descriptions of Turing machines may be found in Turing (1936), Pos: [1943), Kleene {1952}, Davis [1958]. There are ur nportan! technical differences in these formulat ons, For our purposes ‘twill usually be sufficient to use pictorial state diagrams, Our ir vee Haase nvenisns 119 purpose is 19 stow how Turing machines, with their unfinited tape memory, can perform computations beyond th: capacity of finite-state fer to understand the examples in terms of les of functions, While it is fresh in our minds, however, le us ncte that the finite-state parts of our machines can he described nicely by sets of quintuples of the form {old sate, symbol scanned, new state, symtol written, direction of motion). (55. BI 5)e Fe $s BMAD (Qe 5 Gas S40 dy) ic. as quintuples in which the third, fourth, and fifth symbols are de- termined by the first and second through the three functions G, F, and D mentioned above." Thus a certain Turing machire (Section 6.1.1 helow) would be described by the following six quintuples: Co a a Co ) CC CD (qo B uatt, OF =) (qn B MaLT, =) or just 0 6 0 0 1 0 1,0, 1 Ch 0 0) io 0 0) 0, HO, -) a a) where we have reserved the symbol “H "(or WAL) to designate a halting state, ‘One more remark, When we dealt with finite-state machines and the things they could do, we had to regard the input dats as coming from some environment, so that the description of a computation was usually not contained completely in the description of the machine and its initial state, With a Turing machine tape we have now a closed system, for the tape serves as environment for the firite-state machine parl. Merce we can snecify a “compurotion” completely by giving (\) the iniial state of the machine and (2a the contents of the tape OF course we have a'so 1a say (2h) which square of the tape she scauning head sees at rhe start. We will usually assume the machine «tarts in state go "the sate denoted hy gu, dsbred 10 be ths one ofthe as given by the fenton equ an Sy Co ya Ty 120 sHRINe Mactnes sent 4.1 SOME EXAMPLES OF TURING MACHINES The remainder af this chapter shows some of the things Turing imuchines can do to the information placed on their tapes, and contrasts, these processes with those obtainable fram finite-stace machines. (For the comparison, one may think of a finite-state machine as a specially re stricted bind of Turing machine which can movein only one direction.) 67.1 Aporty counter We will se! up a mackine whose output is | or O depending on whether the number of I's ina string of 1's and O's is odd or even. The input string is “epresented on the Turing machine's tape in the form {olor a where we have printed the sequence in question followed by a B. The machine starts (in slate qo) at the beginning of the sequence: the B is to lell the mackine where the sequence ends. The machine needs two state one for odd and ore for even parity, and it changes state whenever it encounters a I. The associated finite-state machine is represented by Tehle 6.1-1 “Table 6.11. ous Tuntes FoR panmty COUNTER ety ty | ty fy ty oofoo:t rolior orto ie) 16! orlno tala. a o Ifwe trac: the operation of the machine we find that it goes through the configurations at the top of p. 121 ‘The machine ends upat the former site of the terminal B which it has replaced hy the answer, The input sequence has heen erased, PROBLEM. Change the quintupless9 shat the sequence is not erased In this simple expe the machine always moves to the right. In such 1 case there is no posshility of recording information on the tape and returning to it at a later time, Hence ene could no: expect it 10 co any: thing thit could not alsa be done by un unaided finite-state machine (with sequential 4901) and we know already, from section 2.2, that this is (rue fer this computation sie, 62 omine anemsrs 121 6.1.2. A parenthesis checker We next give a simple example of a computation that cannot be per~ formed by a finite-state machine with sequential input, The problem is to decide whether a sequence af left and right parentheses is well-formed, that is, whether they can be paired off from inside to outside so that each left parenthesis has a right-hand mate. Thus (((()())())) is well formed, sshile (())) and ){ and {(()})) are not. A good procedure for checking urentheses consists of searching to the right fcr a right parenthesis and then searching {0 the left for its mate and reroving both. One keeps doing this until no more pats are found. If any unmatched symbals re- ‘main, the expression is not well-formed, and conversely. Let us prepare the tapein the form here the beginning and end of the expression are marked by A’s, and use the machine of Table 6.'-2. 122 viyes MACHINES ao Tale 6.12, oni iene tom pamesransss cinexte crjeen erie sr orien eft eo ty fay 6 2 VY moc thott vifoan oe las oe aalat erlo dt Tatty oe Gtlt ee “Tracing out the operation. we have (OU cn ACO Ar ARSC eC) Are acne Axel and we se tha ons pr hos fon removed and the machine i searching fv the next "The stte_Qy f bivaly 4 gltemoving sae wh serche (without changipsynbols anil encounters Tt removes thn hy Ying th and poecto sate By, State Gy bavealy a leon U1)State @y may i not mats Itt reaches an Cubic wl theoneio the Let the michine prints 0 [me-ning mot well formed) and bas""Or 2h state Qyiay ind ao move"), knows th by encoun ine an (which maa Bethe one the Fis). The mache fen emer Sine Q, which checks to we if any “C- remnins there fe one the inihine ain prin's0 snd halt oll partes eemamn (whch the inchinefin thy fchine the ec mand A). he machine pa eel formed!) and halts. : , a 7 Is pose ere Because wt Farge maciae a hack ever arbitraeiy tong intervals! G9 Hine Cs that had assed ner eather Let #6 note in passing an interesting property of this machine. It dees riot make very ruck use of any paticulae tape squate and, indeed, changes itseonents no morc than once. We willshow later(in section 14.5) that any Imichiae is equivaew in sense to one with thi sta. restrictor DIAGRAM CONVENTIONS In most of our machines each state will have the charscter of an uni- directional szarch: each state is usually associated with moves in 2 single direction. The dizgrams can te made simpler and more transparent by recognizing this fact. Thus we can represent the machines of 6,!.1 and 61.2 by the diagrams in Fig. 6,1-1, Each arrow in the diagram represents Sia) oem ten poen Sat FFhrrrrLrLL LULL Ligeah dap % a o* "Ge, oe + 2 Fa, 61 some quintaple gu Sys Sys diy) Then 4, is the state at the tail of the arrow, i the symbol at its (al, s, is written in the middle of the arrow ad omitted ifthe sume ass. 4, i8 ‘he state at the head of the arrow, and ymbol writer inside the hexagon for gy. If two g,’s name the same state but their d's ae diferent, we cannot use this kind 0 diagram ! The most common quintuples, of the form (9,. 5. ds 5,.d,) are simply omitted PROBLEM, Thereader should reconstruct Table 6,1-2 from Fig. 6.1-10h) the sure he understands these conventions. 61.3 Aunary-tocbinary converter In wetinns 3.2.4 and 3.2.5 we described 1 network which converts a sequence of pulses irto a parallel pat-ern enrresponding to the binary “Thee isnot the whale tory however A rerbarkale theorem of Rain and Sot 1989] ‘vom that machines which ean mune Both wine, Pal cin change tie same, fe no ‘more tor less) rowertulthan machines hich con rove ony nme direction, "This notion is based cna sigpetion of NRochoster Cie smportan to seconize that con he es ny i the povulicr cima tha entrng each state sseersted ssith fed virction Hist Rappers that mos! four exanaples satefy 1 eoeton Prod Shivs that ny ashi meen Ye cach "dite tate sche Yee rbmnes seacraes si Oa number representation oft, OF course sued « devise can handle mimbers 1010 4 certain size (dspending on the number of inary sealer unis it contains). We can make a Turing mactine which will do this for all sequences, however large, Let the sequence be represented as a sequence of "son an infinite, otherwise blank tipe LS NSIT! The machine starts at the leftmost 1 and has the diagram shown in Fig 6.1-2. The paired right-moving states act like a parity counter (see section 6.1.1); they alse remove alternate I's (hy ¥-ing them). When the panty counter has passed through the data string, it enters one of moving states, which entersan A or a 8 in the first available space to the felt. When no 1's are left in the data string, the machine halis, It turns cout that the 4°s and A's si written are the binary digits of the original number of I's. To see this, one can verify that at the moments of entering. ther eht-hand R state the tape fas the forms shown below. (The reader shou id trace the machine through all the steps.) Oe eee | eo AY IXY Tet TO Qa AN XY IX NY ¥ 1X OO So the answer is BABA > 1010 = 19 (kase 2). The computation re. peatedly divides hy 2, writes down the remainder (thet is, A or &), and repeats the process on ihe quotient until the quotient hecomes zero, The structure of this process is rather more complex in the previous examples. The tw. parity-counter states may be though! of as a subpcocess whic vis repeated over and ver until some condition, detected bya “aipervisnry” prices, ie attained, We have a “loop within a toon” an ean discern st rudimentary hierarchy of eontrol This computation connot he dane bya finite-state machine PROBLEM 6.141. 11 i interesting thai exactly the sme tesul. achieved hy a inary counter scheme whick requires only two states and the Samessipha nt? Can you find such a worst ate Turing machine? umises snc 125 6.1.4 Avnory sities ‘The machine in Fig, 6.1-3 will muhiply two unary numbers m and mt represented as blocksof I’son a tape of the form (oso TAN I [ADIT = = ET “Themachine starts al the separating B. If, for example, the initial tape is qa the end result will be or? x 3 = 6.where the answer (in unary form) will be found as.a block Sr yrato the right of the terminal 4, Agsin we have a computation that aie dona in any fnie-stale machine for arbitrary values of mar PROBLEM 61-2. Construet Turing machines which {iy compate the square of m. where mis represented a me) (2) compute the sum ef two hinary numbers represented in Form! pol - Wid x} ‘Assume that thay have the same nuns of digits 0) decide whesher ormot the number isa prime mumber very complicated) ama 126 wrRING MAC NMty see 6s PROBLEM 61-3, Descre the be: sto 0. Favior of the machine in Fig. 6 Lod, a ‘shen statted with a blank tape. This ram ' iejustamevercise ny “keepnp trek —" PROBLEM 6.1-4 Design Turing smachinesto enmpate (1) the product ‘90 binary mutters mand my; !2) the exporent function m™ Fin. 614 61.5 An oddiessed memory is not particularly apparent, from the previous examples, how a Taring machine can he constructed to use its tape 2s a general-purpose file for Storing ard retrieving information, The next example shows how one might set up an orderly file in which items couk! be located by Loearion AND fi Suspose that one has a number of items Uj, each of which is asso: ciated with a name N,. Let these he encoded in a binary alphabet and ‘ar. Tangee along a ope in the “orm of pairs fname, item) separated by markers, (We will use X's.) Suppose that we want to locate the item whose mame is N, Weassume, for simplicity, that all ef the names N, have the sarte number ef digs, and that the tape has the fo tome ot — Library region = deseed em & or tet ec a where the parentheses represent sirings of binary digits and the ¥°s are used as additional purcivation, The machine (Fig. 6.1-5) uses two addi tional symbols. 4 and & for beeping track of position, It will compare ToFig6-6 seats roms waenses 127 the lefi-hand name with each of the names in the library, and when it finds a perfect match, itll stop at the starting position, having changed all O's and T's between there and the desired record U(N) to A°s and Bs For example, this machine would convert the tane iginal file can be tecovered by re- placing the 4°s and B's by the corresponding 0's and I's,’ Comune Having Inzated @ file, it may be desirable to move the information to another place If we add the machine in Fig, 6.1-6 to the above. it will take the item U, just located and cope: it nto the block in which irs mame To Fig t2-5 2 5 oe Fig. 61-4, Cony item va: originally located that is after the in slarting. posit the names. The result is to copy the infor after the initia’ ¥: IY, Then it will stop at the n. We assume that the items U, have the sume length as om U, into the “address” block has become "The renler should trace the operation 4 scene the machine works. °F it seems vwrosg. ty aps, being twice suet 128 ses snactnts see Again. i would be a simple matter to add states which would restore the Jape to its initial 0, [format The memory file we tave constructed is a variety knawn as am assert tive memory. ems are recovered diceet y by matching with a name which {s paired with the item, Ina conventional serial computer one retrieves items from a memory by :t more indire:t process, namely, through refer- ence to their location ina fixed stray of storage devices. There are certain advarrtages to having the option of associative memory in a computer, but We Cr Inot stop to discuss ths here 6.2. DISCUSSION OF TURING MACHINE EFFICIENCY The reader who has raced ot the above machines on actal tapes wit have ubserved ino complement feitires ofthe situation. Cn the one hand, he is becoming cnnvinced that one san indzed do. preat many things with Turing machines tha: cannot be done with finite state mi chines and alse that ene can do surprisingly complieated things with rather simple machine ructures. On the ether hind he wil have che served the siogering ineliciency of Turing machines inherent the repent pasize one le Hoo ape perform the mest lemea the vio a Tart muchine stvcture fer any practeat eampueson, Ie deed, 4 do net even know of ane it for demons Nevertheless despite the slowress sf the machines, Rey do nor neces sarily memory ea ty on purposes inellcient use of the t For exarmple, we ean mate a machine to decide ian ndigit binary rrumber is prin, using lss shan» additional tape suuares. Perhaps it Should ase be noted ‘hat the high spec of ardinaty computers s based 9 their use of “randon-access™ Memories which only appear t9 escape the problem of serial sea'ch slong 2 tape Hane thinks «such machines as ccdsting ina st of three-timensional ape, ane can contract arzuments to show that Turing machines of appropriaie kinds are not fundamentally slower than other Kinds offiite-sate-plus-miemory machines, As we will sce. it is possible to execute she mest elaborate possible computation procedures with Turing machines whose fixed structures contain only dozcas of parts, One can imagine an interstellar robot, for whom reliability & the prime eonsiderat on, performing ils computations insuch a leisurely manner, over eos of spare time There are mo silications of the Turing machine framework, €. using The point i hats wih AMG uosecatve meme Aart en ust Anes nat hase to ke whore the several tapes, vfich bring af closer mt ella eng. bth poting machine, but we will not look in tmachanes i it their use as node! Tor defining elective computatality tls. One ead miterest Lee 6.3 SOME RELATIONS BETWEEN DIFFERENT KINDS OF TURING MACHINES. 6.3.1 Two-Symbol Tering machines We have phiced no pirticuki restriction on the variety of symbols that may oceur on the tapes of ur machines, save that cach machine can deal with just sorse finite set cf symbols, I is interesting that we cay restrict ‘our machines sa the use of two symbols, without loss of generality. (In finite-automata theory this is reminiscent of the en} McCulloch-Pitts networks, which have binary signals, to all, less- restricted finite-state machines.) To show the equivalence, ore his to do litle more than replace the symbols hy binary numbers. Suppose thal a Turing machine Fuses & dilferent symbols. Suppose also that the number {has 1 binary digits Then we can assien to cach symbol of T a distinctive n-binary-dipit number, New we can reptice thz machine T by a new machine T* which will reat its tape. in ellset_ as thon its squares were grouped in blocks of length n, Ow each of these blocksis written an n-dizit representation of ‘some symbol of the old machine 7. For each state af the old machine 7 ‘we will give 7 a collection of states. and these will be arranged somewhat Tike the units af the sequential binary decoder 3.3.1, In fact we construct binary tree, # layers deep, of right-moving states, If the machine starts at the felt of a symbol block, then, when it has reached the right end of that block. the position of its state in that binary (ree will tell precisely what symbol (irom 7°s old alphabet) was represented there. 1 is then a Simple matter to attach, to each terminal state of Cais tree, 2 chain of mnlefi-going states which write (in reverse order) the binary dizits of the representation of that symbol which 7 would then have wrilten there. Finally, if Twere to move right, we have te adjoin m rightmosing states, d likewise for motion to the left, A detailed construction 6 given in Shannon [1986], See also section 14 5 for similar construction lence of some 63.2. Single and double infinite lopes I-cam also be shown that Turing mach'nes which have tapes infinite in both cirectinns have mo advantage or disadventape over machines with, singly in inite apes. His not worth showing this here in detail Sulfice it 130. 1oHESes Magers se 684 tw mote that one can show the equivalence hy folding the doubly infinite tapes and then mapping them into the single Lapes by using alternate sqquates fv” each half, ‘Turing [1936] uses this method, See the solution to prablew 74-1 4.3.3. Molliple-tave machines By extending the ea of using alternate squares, and adjoining enough markers and susiliaty states, one can achieve the elfects of having several independent tapes (enntrolled hy r-tuples in the finite-siate machine out- puts) ina single tape. One cam even simulate the effects, of an ndimensicnal memory array Again, we will not go into detail 63.4. Twoustate Turing machines startling reduction was demonstrated by Shennen {1986}; any Turing machine is equivalent to a Turing machine with only rwo in:ernal states! The equivalence is achieved by greatly enlarging the alphabet of the multistate machine. We cannot give deta Is of this remareable demon- stration here, and the interested reader should certainly refer t9 the ofigiral paper, The heart of the argument is cortained in the diagram of Shannon's Table I: this shows how the state information of the original machine can be prese-ved, asthe macHine moves clong ite tape, by a two- square shy tling back and forth, runnirg thrcugh different alphabets. PROBLEM 63-1, Design a Turing machine to enunera.t the binary fumbers, Le. to ofoduce am infinite tape; start with a blank tape and The pron rule is that one a ¥ # printed the riachine must never again change itor moweto the right oF PROMLEM 6.3-2. Design a Turing machine 0» generate all well-formed parenthesis sequences, 6.40 praduce an infinite ape like Al ALTO TRETCE ETORR LO TPA OTE The order docs nat matte, hul no seyvence may appese mote than once. Follow the sme ground rule as in Fst problem, Hint: Enumerate the Finary numbers as in problem 63-1. As they are enerated, interpret them as paremhesis sequences and check then for well foemedness using 6.1.2). IP details hecomme too nasty, j3st sketeh oat the problemssand how to deal with them aa tiene ayes 11 PROBLEM 63-3, We will say that a Loring ma sequence S of Osan Psi staeting with %.. opty - Eitebte| the machine eventually halts with a blank tape. Show how to make Turing ‘machines to accep! exicly the sequences ofthe following classes. (1) 16.1100, 111000, 5... 180" (2) The set of sequences accepted by a given finite-state machine Q) Problem (2), but using only rightmoving siates in the Turing machine (4) Piove that a right-moving Turing mackine cen be replaced by + finite-state machine (8) Can you do preklem (1) with a right-moving machine? Prove it (6) Canyou think ofa set of finite sequences that is not the set accepted by some Turing machine? 7 UNIVERSAL TURING MACHINES 7.0 USING TURING MACHINES TO COMPUTE THE VALUES OF FUNCTIONS In chapter 6 we saw a number of ways to make Turirg machine, manipulate the information on theit tapes. In euch case we started with some information on ihe tape (usually a binary or unary number, but ox casionally a string of symbols). The machine was started in some standart state and tape position and allowed to tun until it halted. When (and st) the mechine stopped. we looked 1 the information now on HS Lape aml regarded this as the reslt of a computation, New in general, what is on the tape when the machine staps wil de pend in some complicated way on what was on the tape at the start Si We cam say that the Jape result af the computation is a fiurstion of the input. Fractly what function its depeads, of course, on what Trine machine was usec. Hence we cam think of a Turing machine as define or computing, oF even as being @ futctinn. Whar iva funcsion’. Mathematicians have sever lent ways of detining this, Perhaps the like this I more oF less equiv st usual definition is somethine A fimetion iva cule whershy, given a number (called the argument). cme ss told hows to compute another number (called the vate of the function for that argument) For example. suppose the rule that defines a function #46 “the rena when the areument iy divided by three.” Then Cf we consicer only 9" negative integers for arsuimen's) we find that MO) = OFA FOV = 2. Faye a, FL = ete mms rnsar iotsts seacansts, 139 fienction is spar way mathematicians may dei rcion is a set of ordered pairs (x, y) such t re no two pairs with the same fret number, but A fun there for each x, there is alweys one pair with first number ofa ‘unction in this way. then the funciion F above is the set ae thi ovpatts (0.0) 1) -@2 BO) 4 65.2) 16.0) Ithereany difference between these defiritions?. Nat really, but there vcneuaal fine a0ints, The second definition is terribly neat; it avoids ae ing lonical points to compute the value of the function for any int x, one just finds the paie that starts with x and the value is the sear hata the pait. No mention is mide of what the ruly relly is, see imight not even be one, though that leaves the uncomfortable ‘Jest af what one coutd ase the Function for, oF in what sense it really ree yi fist definition Ties the function down to some stated rule fer “Nhung its values. but that eaves us the question of what to do if we Thin of different rates for computing the same thing! For example (1) divide the number by three and the value is the inder 2) add up the number's digits (base 10, of course) and divide thar by three and take the remainder ste 90 rules that, as many children know, give the same values(prove it Iewould be a eisance to think of them zs two different functions. ut hs are wea different rules: so we have 1 problem with our first definition. ordinary life, of even in ordinary mathematics, worrying about seh a haitspliiting matter would be silly. One just says, informally, Wel, two ules do in fact compute the same values, we will think of ‘hows defining the same “unction. The different de’initions, while not sh tical are eigivafen!.” Now we will in faet take this common-sense uiproach, hut we have to be eveeful to be clear about it, This is not cause we are trying just “0 be terribly careful ard logical and so forth, her because we sre studying the theory of rules and definitions wrt the tike ws our primary subject matter, We huve to make a clear Istinction between what a rule des and how it is defined bectuse that is svt what we are studying ot besause of am obsessive, or evangel- ‘or therapeutic desire to promote more clear and logical thinking ‘rally Usay this hecause many of the newer mathematics texts delabor {Ws shstmetions between functions sind rukec and ordered pairs to the point Ht the studen! is more eonfused than he was before, precisely hecause in

You might also like