Computation, Computers, and Programs Course Introduction - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

Computation, Computers, and Programs Course Introduction

Description:

... off the 'smooth line art' option in Acrobat, under ... Lots of models: l-calculus, mechanical devices, fluids and valves, DNA, quantum devices... 11 ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 28
Provided by: csCal
Category:

less

Transcript and Presenter's Notes

Title: Computation, Computers, and Programs Course Introduction


1
CS20a Turing Machines (Oct 29, 2002)
  • So far
  • DFA regular languages
  • PDA context-free languages
  • Today
  • Computability

2
Churchs thesis
  • The computable functions are the same as the
    partial recursive functions
  • What is a computable function?
  • Lots of models l-calculus, mechanical devices,
    fluids and valves, DNA, quantum devices
  • All of these seem to define the same set of
    functions (but some have better performance)

3
Definitions
  • A problem is a yes-or-no question
  • Are two CFGs equivalent?
  • Does a TM halt on blank tape?
  • An instance of a problem has specific arguments
  • Does this TM halt on blank tape?
  • An algorithm is a program that always halts (with
    the correct answer), so it is recursive
  • A problem is decidable if it is recursive
  • If not, it is undecidable
  • Classically, every instance of a problem is
    decidable
  • Not true constructively

4
Some properties
  • The complement of a recursive set is recursive
  • Given M that halts on all inputs, construct M
    that simulates M.
  • If M halts and accepts, M halts and does not
    accept
  • If M halts and does not accept, M halts and
    accepts
  • The union/intersection of two recursive sets is
    recursive
  • Simulate machine M1, then simulate machine M2
  • Union accept if either accepts
  • Intersection accept if both accept
  • If L and (Sigma - L) are r.e., then L is
    recursive

5
Writing down a Turing Machine
6
Universal Turing Machines
7
Reals are uncountable
  • Cantors diagonalization argument

8
Another diagonalization argument
9
Halting problem
  • Problem determine entries in the matrix
  • Find a recursive machine K, given Mx
  • K halts and accepts if M accepts x
  • K halts and rejects if M does not terminate
  • Is there such a machine?
  • Suppose so, then build a new machine N, that,
    given x, runs K on Mxx and
  • Accepts if K rejects
  • Loops forever of K accepts
  • If K exists, then N does too let N My
  • Ny halts and accepts if Ny does not halt
  • Ny loops forever if Ny halts

10
Halting problem
11
Some undecidable problems
  • Determining if M halts on blank tape
  • To test if M halts on string x, build a machine
    that writes x onto the tape, then simulates M
  • Determining whether L(M)
  • To test if M halts on string x, build a machine
    that erases the input, writes x onto the tape,
    then simulates M (accept iff M terminates)
  • Determining whether L(M) L(M)
  • Let M be the machine that always halts and
    rejects

12
Rices theorem
  • A property P is a set of r.e. languages (so it is
    a set containing sets of strings)
  • For any r.e. language L, we say P(L) is true iff
    L is a member of P
  • Theorem Any nontrivial property of the r.e.
    languages is undecidable
  • Nontrivial means the property is neither always
    true nor always false

13
Proof of Rices theorem
  • Consider a property P
  • Assume P() false, otherwise invert P
  • Since P is nontrivial, there is a language L in P
  • Let ML be a TM accepting L
  • To determine if M halts on input w, build M
  • Ignore the input, and simulate M on w
  • If M halts, then start ML on the input string
  • So P(M) iff M halts on w

14
Properties of TMs (not r.e. languages)
  • Example 1 it is decidable if a TM has more than
    10 states
  • Count them

15
Properties of TMs (not r.e. languages)
  • Example 2 it is undecidable if a TM every prints
    3 consecutive 0s
  • For any M, construct a new machine M that
    represents 0 by 01, and 1 by 01
  • Use M to simulate M (M never has 3 consecutive
    0s on the tape)
  • Except if M halts, then M prints 3 zeros

16
Properties of TMs (not r.e. languages)
  • Example 3 it is decidable if a TM ever scans a
    tape cell 4 or more times
  • If the TM never scan a cell 4 or more times, then
    each crossing sequence (where tape head move past
    the boundary between cells) happs at most 3 times
  • But there is a finite number of crossing
    sequences of length 3 or less
  • So the TM either stays within a fixed number of
    cells, or some crossing sequence repeats
  • If some crossing sequence repeats, the tape head
    move right with a detectable pattern, and the
    problem is decidable

17
TM executions
  • Lets revisit the past
  • This time with readable symbols

18
Instantaneous descriptions
19
Transitions
20
Executions
21
Valid computations (VALCOMPs)
22
Context-free/VALCOMP
23
CFG intersection
24
Invalid computations
25
Invalid computations
26
CFGs
27
Turing Machines
  • TM are basically 2-way FA, with a writable tape
  • The TM accept the r.e. languages
  • TM that always halt accept the recursive
    languages
  • Every known computational model can be mapped to
    TM (Churchs thesis)
  • Nearly everything about TM is undecidable
  • Wonderful!
Write a Comment
User Comments (0)
About PowerShow.com