Artificial Minds - Spring 2009 Class notes for Thursday, February 5 (week 3) =============================================================================== DISCLAIMER: These are my own working lecture notes, which I'm posting here in case they're useful. I'll try to post my notes on a more or less regular basis (assuming that I have some to post), but I make no guarantees as to their completeness or comprehensibility. They're also not too pretty, unless you're a fan of plain text and ASCII art, so I'd recommend using them as a supplement rather than a replacement for your own note-taking. In other words, you're still responsible for the material we cover in class, whether or not that material is included here. =============================================================================== Turing machines --------------- Quick review of TMs - show a demo of Looper, Multiplier Dennett's Intentional Stance Understanding the behavior of Multiplier TM - physical stance: predict output based only on rules - design stance: predict output based on product of input numbers - intentional stance: ? TM does not have beliefs or desires Hofstadter's domino-chainium - physical stance: predict whether final domino will fall based on the detailed physical configuration and forces acting on the dominos - design stance: predict whether domino will fall based on whether the number of "input" dominos is a prime number. A "Cat-simulator" TM - input: a retinal image encoded as a huge string of bits (0's and 1's) - output: 1 (flee in terror), 11 (stalk and pounce), or 111 (yawn) - extremely complicated set of rules - physical stance: predict TM behavior using only rules and input bits - design stance: predict TM behavior using "meaning" of input bits (what does the image represent?) and knowledge of typical cat behavior - intentional stance: predict TM behavior using memories, beliefs, fears, etc. of this particular cat (who had traumatic experiences in kittenhood with mice) Back to TMs... Is this really enough to compute *everything*? - memory is not a problem (infinite tape) - speed/efficiency is not a problem (purely theoretical question) - data representation is not a problem (we can use binary, or anything we like) - anything can be encoded in binary: numbers, pictures, sounds, movies, etc. - a string of bits is just some huge number "in disguise" - manipulating pictures/words/movies/etc is just transforming big numbers - all attempts to characterize computation have turned out to be equivalent: - Turing machines (Turing) - Partial recursive functions (Go"del, Kleene) - Lambda calculus (Church) - Post production systems (Post) - Unlimited register machines (Cutland) - Random access machines (Cook and Reckhow) Church-Turing Thesis: Anything that can be computed can be computed by a TM Choice of programming language does not matter - all are "Turing equivalent" When we talk about Turing machines, we are really talking about computer programs in general Corollary: If the human mind is really a kind of computer, it must be equivalent in power to a Turing machine ----------------------------------------------------------------------------- Universality A single TM, properly programmed, can simulate any other TM This type of machine is called a Universal Turing Machine +---------------+ [Input for TM1] -->| TM1 |----> output OUT1 +---------------+ +---------------+ [Coded description of TM1] -->| Universal TM |----> output OUT1 [Input for TM1] -->| (UTM) | +---------------+ - UTM accepts a coded description of TM1 and simulates its behavior on the input - coded description acts as a "program" that UTM executes - UTM's own internal program is fixed - existence of UTM is what makes computers fundamentally different from other machines - computers are the only machines that can simulate any other machine to an arbitrary degree of accuracy The principle of universality is why computers have taken over the world! Without universality, we might have this situation: - computer model I: $500, can do arithmetic, math functions, run personal finance programs, but not powerful enough to run web browsers - model II: $1000, can run web browsers, image processing programs, board games (chess, checkers, etc.) and card games, word processing, email, but not powerful enough to run fancier programs - model III: $2000, can run everything, including music software (iTunes, Garageband), adventure games, powerpoint, etc. Fortunately, this is not the case, because all computers are universal machines. Independence of formal systems on physical substrate - toilet paper TM example (from Hofstadter handout) - beer can computer - tinkertoy computer (see photos, Scientific American October 1989) - the key is the logical pattern of information, not the physical substrate ----------------------------------------------------------------------------- How can we "encode" a TM? Here's one way: 111 0...0 1 0...0 1 0...0 1 0...0 1 0...0 11 .................... 11 .... 111 old old new new move state symbol state symbol ----------------rule1---------------- -------rule2-------- ...etc... Example: States: 0, 00, 000, etc. Symbols: 0, 00, 000, etc. Moves: 0, 00, 000 Rules: 1 y 3 y > ===> 01001000100100 2 x 4 z < ===> 001010000100010 TM: 1110100100010010011001010000100010111 (= 125,129,498,903 in decimal) ----------------------------------------------------------------------------- The Halting Problem Is there anything a TM *cannot* compute, in principle? YES! No TM can infallibly tell in advance if another TM will get stuck in an infinite loop. +----------------+ [Coded description of TM1] -->| Halt-predictor |----> "Yes TM1 will halt" [Input for TM1] -->| TM |----> "No TM1 will never halt" +----------------+ +----------------+ [Computer program] -->| Bug-detector |----> "Yes it works perfectly" [Input for program] -->| program |----> "No there's a bug" +----------------+ The task of deciding if an arbitrary computation will ever terminate cannot be described computationally. How did Turing prove such a thing? Outline of argument: 1. Assume for the moment that such a Halt-predictor TM *does* exist. For example, take the Looper TM, whose description is some big number L. We could give the Halt-predictor machine [L # 00000] on its tape as input. After some analysis, the Halt-predictor would stop and say "yes L will halt if you run it on 00000", or if we gave it [L # 000111], it would say "no L won't halt if you run it on 000111". 2. Now, I will create a new, slightly more complicated TM based on the Halt-predictor, called Paradox. What does Paradox do? - it takes a single TM description number M as input - it then simulates the behavior of Halt-predictor on the input [M # M], using the same rules that Halt-predictor uses, to determine the answer to the question: what will M do if you feed it its OWN machine number M? - if the Paradox machine determines that M will halt, then it purposely goes into a loop forever - if Paradox determines that M will never halt, then it immediately stops +---------------------------------+ | Paradox TM | | +---------------------------+ | Description number of =======> | | Simulates the behavior of | | some Turing machine M | | Halt-predictor on [M # M] | | | +---------------------------+ | | yes || no || | | \/ \/ | | +---------+ +------+ | | | go into | | stop | | | | a loop | +------+ | | +---------+ | +---------------------------------+ 3. Now, what happens if I feed Paradox its OWN description number P? - it simulates the behavior of Halt-predictor on [P # P] - if Halt-predictor says "yes, P will halt when you give it P" then Paradox loops forever, which contradicts what Halt-predictor claimed! - if Halt-predictor says "no, P will never halt when you give it P" then Paradox immediately halts, which contradicts Halt-predictor again! We get a logical contradiction either way! Conclusion: Assumption #1 (that Halt-predictor could exist) must be false. The problem of predicting the behavior of an arbitrary TM on some input is therefore "undecidable". This is not just a contrived anomaly. The class of undecidable problems turns out to be infinitely large! Corollary: If the human mind is really a kind of computer, it must be subject in principle to the theoretical limitations discovered by Turing, at some level.