Combining Turing Machines - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Combining Turing Machines

Description:

... Use Comparer calculation to end up in qx or qy. qx begins the adder computation. qy erases all other ones and puts a zero at ... An interesting class of TMs... – PowerPoint PPT presentation

Number of Views:324
Avg rating:3.0/5.0
Slides: 17
Provided by: jonahC
Category:

less

Transcript and Presenter's Notes

Title: Combining Turing Machines


1
Combining Turing Machines
  • Reading 9.2-10.4

2
Combining TMs
  • We can string together Turing Machine
    computations in order to compute more complicated
    functions.
  • f(x) xy if x gt y 0 if x lt y
  • Answer Use Comparer calculation to end up in qx
    or qy.
  • qx begins the adder computation
  • qy erases all other ones and puts a zero at the
    end.

3
If - else
  • We now can do some if-else constructions
  • If a then qj else qk
  • Read an a, then go to qj without writing or
    moving the head (that is, move right, then left)
  • If the symbol was not an a, go to qk without
    changing anything.

4
Subroutines
  • Call a subroutine in a Turing Machine.
  • Want to stop computation A, go to a separate part
    of the tape, and do computation B. Then return
    to computation A in the same place on the tape.
  • How it works
  • Before calling B, A copies inputs into a shared
    tape space (indicated by a separator)
  • A transitions into the initial state of B
  • B uses its tape space to compute
  • B writes relevant output to the shared space
  • Bs final state now points back into a state in A.

5
Example x times y
  • Initially, the tape should have leading zeroes,
    ones denoting x, a zero, then ones denoting y.
  • At the end, it should have ones denoting xy at
    the beginning of the input.
  • 1. Repeat until there are no more 1s in x
  • Find a 1 in x and replace it with another symbol,
    a
  • Replace the leftmost 0 by 0y.
  • 2. Replace all as with 1s.

6
Turings Thesis
  • Can Turing Machines do anything computers can do?
  • Hmm - depends on the definition of computer!
  • Turings thesis(mid-30s)
  • Any computation carried out by mechanical means
    can be carried out by a Turing Machine.

7
Turings thesis true or false?
  • Cant prove it, because we cant foresee what
    mechanical means people might come up with in
    the future.
  • Could disprove it with one counterexample...

8
Evidence Supporting Turings thesis
  • Anything that can be done on an existing digital
    computer can be done on a Turing Machine
  • We can prove this - just write a TM for each
    machine instruction.
  • No one has been able to suggest a problem
    solvable by an algorithm but not a TM
  • Many alternative models of digital computers have
    been proposed - but none are more powerful than
    TMs

9
Algorithm definition
  • An algorithm for a function is a Turing Machine
    that halts with the correct answer on the tape
    for any input in the domain.

10
Other types of automata
  • Given another type of automata, how do you know
    which is more powerful?
  • Simulation - show how anything done with one type
    of automata can be done with the other
  • Example I can simulate with a PDA any FSA.
    Therefore PDAs as powerful (maybe more) than FSAs.

11
Example
  • Any FSA can be written as a PDA
  • So PDAs are at least as powerful.

12
Variations on TMs
  • Add a stay-option
  • Tape is only unbounded in one direction
  • Separate read-only tape for input (off-line TM)
  • Multiple storage tapes
  • Multi-dimensional tape (extends infinitely in 2
    dimensions)
  • Non-deterministic TMs (not presently possible
    with todays computers)
  • All these are equivalent automata to Turing
    Machines!

13
Non-deterministic TMs
  • An interesting class of TMs...
  • Equivalent in power to TMs (so everything
    computable by a ND-TM is computable by a TM)
  • BUT, it takes more steps on a TM than a ND-TM.
    We think it takes exponentially more steps...
  • This is where the classes P and NP come from...
  • P set of all problems computable by a TM in
    polynomial time
  • NP set of all problems computable by a ND-TM in
    polynomial time
  • P NP? Unknown...

14
Detour into 331...
  • NP-Complete set of all problems in NP that are
    polynomial-time reducible to ALL problems in NP.
  • Meaning, if you can solve 1 NPC problem in
    polynomial time, you can solve ALL NP problems in
    polynomial time, and P NP
  • Cooks Theorem SAT is NP-Complete
  • How did this work? He showed that every ND-TM
    has an equivalent SAT expression!!
  • From that it is easy to reduce other NP-problems
    to SAT to prove that they too are NPC
  • Hamiltonian paths (Traveling salesman)
  • Cliques

15
Universal Turing Machines
  • Are computers more powerful because they are
    programmable?
  • Universal Turing Machine takes its own
    specification as input.
  • Are Universal Turing Machines more powerful?

16
Universal TMs
  • Universal TMs have been constructed from
    multi-tape TMs. One tape gives the input, one
    gives the internal storage, one tape is the
    program telling the machine what to do next.
  • Since multi-tape TMs are equivalent to TMs,
    Universal TMs are equivalent to TMs!
Write a Comment
User Comments (0)
About PowerShow.com