CS 342 Lecture -*- Outline -*- * Turing machines (A. Turing, 1936) ** Turing's thesis (Why we're interested) every algorithmic problem solution can be represented by program of some Turing machine. want to compare langauges, compare them on the same problem. ** Informal presentation *draw picture with tape extending to right* finite state control, "final state light" storage tape (one-way tape of cells), read/write head tape is unbounded => can store and retrieve unlimited info. *** primitive actions: read a symbol, write a symbol, move right or left one cell (and change state) direction and symbol written depend on state and symbol read *** Example: TM that recognizes 1* Input alphabet = {0,1} transititions (show *graphically*) q0: read 1, write 1, move right, goto q0 read 0, write 0, move right, goto error read Blank, write Blank, move right, goto halt ** Formal def: T = (K, Sigma, Gamma, delta, q0, F) K is finite set of states Gamma is finite set of tape symbols, with B for blank Sigma is the input alphabet, a subset of Gamma\{B} delta is the next move function delta: K\F x Gamma -> K x (Gamma\{B}) x {L,R} delta is partial: in particular not defined on final states, may not be on others q0 is the start state, an element of K F is a set of final states, a subset of K *** Configuration: (q, alpha, i) q is current state alpha is the nonblank portion of the tape (a string in (Gamma\{B})* ) i is the distance from the left where the tape head is (leftmost location is 1) *** inital configuration: (q0, input-string, 1) *** halting configuration (q, alpha, i) where delta(q,alpha[i]) is not defined *** accepting configuration: a halting configuration where q in F