{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# Notes-SecG - Turing Machines and the Halting Problem COT...

This preview shows pages 1–7. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Turing Machines and the Halting Problem COT 4210 Spring 2001 Dr. David A. Workman School of EE and CS April 19, 2001 (c) Dr. David Workman COT 4210 2 Turing Machines • DEFINITION A Turing Machine is a 7-tuple, M = (Q, Σ , Γ , δ , q , B, F), where Q = Finite non-empty set of states. q = initial state F = set of Final states (if M ever enters a final state, M accepts its input) Σ = input alphabet; B ∉Σ Γ = tape alphabet; {B} ∪ Σ ⊆ Γ δ : Q × Γ→ Q × Γ× {L,R} a 1 a 2 …. a n BBBBB… Finite Control (q) original input unlimited “empty” memory Left Move Right Move April 19, 2001 (c) Dr. David Workman COT 4210 3 Example: L = {0 n 1 n | n ≥ 0 } Key Ideas – Use 1 tracks 1. input track : contains a string over the alphabet {0,1,B} • Use Multiple Passes 1. Using primarily the state component, accept or reject the “obvious” inputs. e.g. accept “ λ ”, and reject any inputs not of the form {0} + {1} + . 2. On each forward pass, mark a “0” with “\$” and scan for an unmarked “1”. If found, mark with an “X” and perform a backward pass. 3. On each backward pass, ignore “X”s, “1”s and “0”s until a “\$” is found – this marks the boundary between marked and unmarked “0”s. During a backward scan, remember in the state whether or not an unmarked “1” remains. If all “1”s are marked, then there should not be any unmarked “0”s – halt and reject if one is found, else accept. Repeat 2. if an unmarked “1” and an unmarked “0” still exist on the tape. 000 111 initial input \$\$\$ XXX final input April 19, 2001 (c) Dr. David Workman COT 4210 4 Example: L = {0 n 1 n | n ≥ 0 } continued 1 2 7 6 5 3 4 accept! B / B ← Read/ Write- Move B / B ← → / \$ → / → 1 / 1 → 1 / 1 → B / B ← 1 / X ← 1 / 1 ← 1 / 1 ← / ← start X / X ← \$ / \$ ← \$ / \$ → April 19, 2001 (c) Dr. David Workman COT 4210 5 Example: L = {0 n 1 n | n ≥ 0 } Key Ideas – Use 3 tracks 1. input track : contains a string over the alphabet {0,1,B} 2. work track : a string over {B, √ } used to mark input symbols that have been compared in the matching processed. 3. control track : a string over {B, \$, #} used to mark the leftmost (\$) and rightmost symbols (#) of the input. • Use Multiple Passes 1. Using primarily the state component, accept or reject the “obvious” inputs. e.g. accept “ λ ”, and reject any inputs not of the form {0} + {1} + . 2. Using track 2, mark “matching” input symbols with a √ . A “0” matches a “1” if and only if they appear at the same position relative to the right end of their respective substrings, {0} + and {1} + . 0000 111 √ √ √√ \$ # Track 1 Track 2 Track 3 April 19, 2001 (c) Dr. David Workman COT 4210 6 Example: L = {0 n 1 n | n ≥ 0 } continued 1 2 7 9 6 8 5 3 4 accept!...
View Full Document

{[ snackBarMessage ]}

### Page1 / 33

Notes-SecG - Turing Machines and the Halting Problem COT...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online