CSE 105
THEORY OF COMPUTATION
Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/
CSE 105 THEORY OF COMPUTATION Fall 2016 - - PowerPoint PPT Presentation
CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/ T oday's learning goals Sipser Ch 1.4, 2.1 Introduction to T uring Machines Confjgurations and computations Deciders and Recognizers ??? ???
Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/
uring Machines
Context-free languages Context-free languages Regular languages Regular languages ??? ???
memory
blank
qreject ≠ qaccept qreject ≠ qaccept
Is this a deterministic model? A) Yes B) No C) It depends on the state diagram D) It depends on the input E) I don’t know
1) If input is #
1) Move right skipping all c’s 2) If input is [_], then accept, else reject
2) Read a or b, store in internal state, and change it to c 3) Move right until read # 4) Move right skipping all c’s 5) Read a or b, matching the symbol read in step 1.
1) If mismatch → reject 2) If match, overwrite with c
6) Move left until read # 7) Move left until read c 8) Go back to 1).
system at any point during computation
–
Internal state (Q)
–
T ape content (Γ*)
–
Position of tape head
–
q: internal state
–
α: tape content to the left of tape head
–
β: tape content from tape head to the right
–
Sequence of confjgurations
–
Start from initial confjguration C0=(ε,qs,w)
–
Move from one confjguration Ci to the next Ci+1 according to δ
–
Until reaching halting confjguration (…,qa,…) or (…,qr,…)
–
Sequence of confjgurations
–
Start from initial confjguration C0=(ε,qs,w)
–
Move from one confjguration Ci to the next Ci+1 according to δ
–
Until reaching halting confjguration (…,qa,…) or (…,qr,…)
What is the maximum length
A) Same as input length B) At most length of input C) May be longer than input, but it is always fjnite D) May be fjnite or infjnite E) I don’t know
–
Sequence of confjgurations
–
Start from initial confjguration C0=(ε,qs,w)
–
Move from one confjguration Ci to the next Ci+1 according to δ
–
Until reaching halting confjguration (…,qa,…) or (…,qr,…)
Does M need to read the whole input w before halting? A) Yes, computation terminates
B) Only before accepting w C) No. M may accept or reject without reading w entirely D) I don’t know
–
Sequence of confjgurations
–
Start from initial confjguration C0=(ε,qs,w)
–
Move from one confjguration Ci to the next Ci+1 according to δ
–
Until reaching halting confjguration (…,qa,…) or (…,qr,…)
Which of the following is true? A) Computation may visit both qa and qr B) Computation may visit qa more than once C)Computation may visit qb more than once D) Computation may visit qs more than once E) None of the above
TM M
decider M
TM M
decider M Which of the following is true? A) If X is decidable, then X is recognizable B) If X is recognizable, then X is recognizable C) If X is decidable, then X is decidable D) A and C, but not C E) I can’t decide, I do not recognize this question :(
uesday Nov 1 TBA