Download presentation
Presentation is loading. Please wait.
Published byElmer Turner Modified over 9 years ago
1
Computability Chapter 5
2
Overview Turing Machine (TM) considered to be the most general computational model that can be devised (Church-Turing thesis) TMs are a litmus test for computational feasibility – If a task can be done on a Turing machine, it is feasible If it cannot, it is considered infeasible There are well-defined tasks, notwithstanding, that cannot be done on a TM Different flavors of TM have been devised Multi-tape, multi-head TMs Nondeterministic TMs All can be shown to be equally powerful vis-à-vis feasibility Universal TM can be defined
3
The Standard Turing Machine Model
4
The Standard Turing Machine Model (cont.) Two modes of TM use vis-à-vis languages:
5
Programming the Turing Machine Programs can be expressed as a functional table: Or as a transition diagram: Start q1q1 h ,, 0,R 1,R
6
Programming the Turing Machine (cont.) Another program expressed as a functional table: q1q1 Start q2q2 q3q3 q4q4 q5q5 h 0, 1, ,, 0,R 1,R ,R,R 0,R 1,R ,R,R 0,0 1,0 ,0 0,1 1,1 ,1 And as a transition diagram:
7
Extensions to the Standard Turing Machine Model Double-ended tape Turing machine: tape is of indefinite length on both sides
8
Extensions to the Standard Turing Machine Model (cont.) Can be simulated by a standard TM whose one, single-ended tape has two tracks: upper track recording right half of the double-ended tape and lower track recording left half Control Unit Tape Unit
9
Extensions to the Standard Turing Machine Model (cont.) THEOREM 5.2.0 For each double-ended Turing machine M d there is a standard Turing machine M such that a terminating T-step computation by M d can be simulated in O(T 2 ) steps by M. Proof (sketch): Simulate each move of the double-ended tape TM M d on a standard TM M by scanning the tape to determine the position of and symbol scanned by the head of the double-ended TM M d O(T); and then simulating the operation to mimic what M d would do O(1) Control Unit Tape Unit
10
Extensions to the Standard Turing Machine Model (cont.) k-tape Turing machine: one control unit and k single-ended tapes of indefinite length
11
Extensions to the Standard Turing Machine Model (cont.) k-tape Turing machine: can be simulated by a standard Turing machine whose one tape has k tracks and a large tape alphabet Control Unit
12
Extensions to the Standard Turing Machine Model (cont.) Proof (sketch): Simulate each move of the k-tape TM on the standard TM by scanning its single tape and collecting information that the control unit of the k- tape TM would “know” from each of its k tape heads O(T); and then simulating the move of the k-tape TM by altering its single tape at the appropriate cell O(T) Control Unit
13
Extensions to the Standard Turing Machine Model (cont.) Proof (sketch): Simulate the moves of the nondeterministic TM M ND on input w with a standard TM M D by using three tapes one tape is read-only and contains the input w which is never altered; another tape is a “work tape” which is used to simulate M ND yet another tape contains the current “guess” or sequence of choices used in simulating M ND Start 1,1 1,R
14
Configuration Graphs configuration allows for “reconstruction” of TM and its current state from a string representation x1x1 x2x2 xjxj xnxn x j+1 xj1xj1 p state
15
Configuration Graphs (cont.) configuration allows for “reconstruction” of the k-tape TM and its current state from a string representation x1x1 x2x2 xkxk p state h1h1 h2h2 hkhk
16
Configuration Graphs (cont.) initial state configuration final state configuration
17
Phrase-Structure Languages and Turing Machines
18
Phrase-Structure Languages and Turing Machines (cont.) Language generated by this grammar is L(G) = {a n b n c n |n 1} Sample derivation S aSBC aaBCBC aaBBCC aabBCC aabbCC aabbcC aabbcc (a) (b) (c) (d) (e) (f) (g)
19
Phrase-Structure Languages and Turing Machines (cont.) Proof: Design a phrase-structure grammar that would capture the (d)evolution of the acceptance of a string w by a TM. starting with the acceptance configuration of [h 1 ], grammar rules will allow us to trace backwards towards the start configuration of [s w 1 w 2 …w n ] yet other grammar rules will then strip extraneous symbols such that only the string w 1 w 2 …w n remains establish that any string w accepted by some TM can be generated by a phrase- structure grammar establishing the theorem [s w1w2…wn][s w1w2…wn] [h1][h1] Configuration graph of TM acceptance of w S [h 1 ] … [s w 1 w 2 …w n ] … w1w2…wn … w1w2…wn
20
Phrase-Structure Languages and Turing Machines (cont.) Proof: Design a phrase-structure grammar that would capture the (d)evolution of the acceptance of a string w by a TM. Let deterministic TM be M = ( ,Q, ,s,h) The desired grammar G = ( N, T, R,s) is such that N = Q {s, ,[,]} T = and the grammar rules are:
21
Phrase-Structure Languages and Turing Machines (cont.) Proof: Design a TM that would accept a string w if it is possible to generate it with the production rules of a phrase-structure grammar G and “hang” when it isn’t possible to do so TM will be a 2-tape nondeterministic TM One tape will hold the candidate string w; the other will be a “work” tape w w’w’ Control Unit input tape work tape TM nondeterministically simulates the production of string w’ by the phrase- structure grammar G on the work tape If no production produces w, TM enters into an infinite loop
22
Universal Turing Machines allows for the complete and accurate definition and description of a standard TM with a string
23
Universal Turing Machines (cont.) Previous example would be encoded canonically as: q1q1 Start q2q2 q3q3 q4q4 q5q5 h 0, 1, ,, 0,R 1,R ,R,R 0,R 1,R ,R,R 0,0 1,0 ,0 0,1 1,1 ,1
24
Universal Turing Machines (cont.) A Universal Turing Machine (UTM) is capable of simulating an arbitrary Turing Machine M on an arbitrary input word w. One possible UTM is a two-tape TM that may be described as: One tape is a work tape, starts out as containing w; Second tape is the program tape, starts out as containing (M), the canonical encoding of M Tape symbol alphabet is: w (M)(M) Control Unit work tape program tape
25
Universal Turing Machines (cont.) A Universal Turing Machine (UTM) is capable of simulating an arbitrary Turing Machine M on an arbitrary input word w. One possible UTM is a two-tape TM that may be described as: The UTM simulates M by locating on the program tape the appropriate transition given the current state of M and the symbol on the work tape being scanned by its head When the transition is located, the UTM carries out the operation on the work tape There is a standard UTM equivalent to this two-tape UTM w (M)(M) Control Unit work tape program tape
26
Encoding of Strings and Turing Machines Any set of strings can be arranged in lexicographic order based on the “order” of the symbols as listed in its alphabet set = { , , }S: {, , , , } S’: { , , , , } Turing machines can be listed in lexicographic order based on the “order” of their canonical encodings (strings over some alphabet) Generating the jth Turing machine can be mechanized TM Generator j (Mj)(Mj)
27
Limits on Language Acceptance A language L is decidable (or recursive) if there is a TM that halts on all inputs and accepts just the strings of L A language L is recursively enumerable if there is a TM that accepts just the strings of L, possibly not halting on strings not in L. A language L is unsolvable if it is recursively enumerable but not decidable
28
Limits on Language Acceptance (cont.) The following results identify three languages that are decidable: The following result identifies a language that is not recursively enumerable: Proof: By contradiction and use of diagonalization.
29
Limits on Language Acceptance (cont.) The following results identify a language that is unsolvable (i.e., recursively enumerable but not decidable): Proof: Reclassify states, switching accepting and non-accepting. Proof: Using a Universal Turing machine, run M i with input w i. This shows the language is recursively enumerable. Since its complement is not recursively enumerable, therefore not decidable, it cannot be itself decidable.
30
Reducibility and Unsolvability Use the “traditional” technique of reduction to establish that other languages are unsolvable: By contradiction: assume that an algorithm A exists for candidate language L then show we can use A to obtain an algorithm for a language previously known as unsolvable A (solves L) R (translates L to A) input to L input to A output Algorithm for L
31
Reducibility and Unsolvability (cont.) Existence of such a “reducing algorithm” means one can mechanize the acceptance of one language by using the mechanism of accepting the other language:
32
Reducibility and Unsolvability (cont.) This lemma is useful in arriving at unsolvability results: A (solves L 2 ) R (translates L 1 to L 2 ) input to L 1 input to L 2 output “Algorithm” for L 1
33
Reducibility and Unsolvability (cont.) Use this reducibility lemma to establish that the following language is unsolvable (i.e., recursively enumerable but not decidable): Proof: Use encoding of M and w as input to universal Turing machine and simulate M with w as input. This establishes recursive enumerability. Use Lemma 5.8.1 to establish non-decidability by reducing L 1 to L H. The “reducing algorithm” generates the ith input string and the ith Turing machine and uses those as input to “imaginary” machine deciding L H and then “reverses” the polarity of the output. This decides L 1.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.