Turing machines
This presentation is the property of its rightful owner.
Sponsored Links
1 / 38

Turing Machines PowerPoint PPT Presentation


  • 195 Views
  • Uploaded on
  • Presentation posted in: General

Turing Machines. Chapter 3.1. Plan. Turing Machines(TMs) Alan Turing Church-Turing Thesis Definitions Computation Configuration Recognizable vs. Decidable Examples Simulator. Alan Turing. Alan Turing was one of the founding fathers of CS.

Download Presentation

Turing Machines

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Turing machines

Turing Machines

Chapter 3.1


Turing machines

Plan

  • Turing Machines(TMs)

    • Alan Turing

      • Church-Turing Thesis

    • Definitions

      • Computation

      • Configuration

      • Recognizable vs. Decidable

    • Examples

    • Simulator


Alan turing

Alan Turing

Alan Turing was one of the founding fathers of CS.

  • His computer model the Turing Machine(1936)was the inspiration for the electronic computer that came two decades later

  • Was instrumental in cracking the Nazi Enigma cryptosystem in WWII

  • Invented the “Turing Test” used in AI

  • The Turing Award. Pre-eminent award in Theoretical CS (called the “Nobel Prize” of CS)


Church turing thesis

Church-Turing Thesis

  • Thesis- Every effectively calculable function is a computable function

  • Everything that is computable is computable by a Turing machine

  • The thesis remains a hypothesis

    • Despite the fact that it cannot be formally proven the Church–Turing thesis now has near-universal acceptance.


Turing machine

Turing Machine

  • Most powerful machine so far…

    • Similar to a finite automata

      • Uses infinite tape as memory

      • Can both read from and write to the tape

      • Read/write head can move left/right

      • Accept/reject take affect immediately

  • Cannot solve all problems


Comparison with previous models

Comparison with Previous Models


Formal definition of a tm

Formal Definition of a TM


Successor program

SuccessorProgram

  • Sample Rules:

    • If read 1, write 0, go right, repeat.

    • If read 0, write 1, HALT!

    • If read “”, write 1, HALT!

  • Using these rules on a tape containing the reverse binary representation of 47 we obtain:


Successor program1

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program2

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program3

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program4

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program5

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program6

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program7

SuccessorProgram

So the successor’s output on 111101 was 000011 which is the reverse binary representation of 48.

Similarly, the successor of 127 should be 128:


Successor program8

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program9

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program10

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program11

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program12

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program13

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program14

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program15

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Successor program16

SuccessorProgram

If read 1, write 0, go right, repeat.

If read 0, write 1, HALT!

If read “”, write 1, HALT!


Drawing the machine

Drawing the machine

  • Draw the machine

    • Description

      • If read 1, write 0, go right, repeat.

      • If read 0, write 1, HALT!

      • If read “”, write 1, HALT!


Tm dynamic picture

TM Dynamic Picture

  • A string w is accepted by M if after being put on the tape then letting M run, M eventually enters the accept state. Therefore, w is an element of L(M) - the language accepted by M.

  • We can formalize this notion as follows:


Tm formal definition dynamic picture

TM Formal DefinitionDynamic Picture

Suppose TM’s configuration at time t is given by uapxvwhere pis the current state, ua is what’s to the left of the head, x is what’s being read, and vis what’s to the right of the head.

If d(p,x) = (q,y,R) then write:

uapxv uayqv

With resulting configuration uaypv at time t+1. If, d(p,x) = (q,y,L) instead, then write:

uapxv uqayv

There are also two special cases:

  • head is forging new ground –pad with the blank symbol 

  • head is stuck at left end –by def. head stays put

    NOTE: “” is read as “yields”


Tm outcomes

TM outcomes

Three possibilities occur on a given input w :

  • The TM M eventually enters qacc and therefore halts and accepts. (w  L(M) )

  • The TM M eventually enters qrej orcrashes somewhere. M rejectsw . (w L(M) )

  • Neither occurs! I.e., M never halts its computation and is caught up in an infinite loop, never reaching qacc or qrej.  In this case w is neither accepted nor rejected. However, any string not explicitly accepted is considered to be outside the accepted language. (w  L(M) )


Recognizable vs decidable

Recognizable vs. Decidable

  • Recognizable- The TM recognizes the language but doesn’t necessarily reach an accept or reject state (could loop FOREVER )

  • Decidable- is recognizable and guaranteed to reach an accept or reject state (without the possibility for an infinite loop )


Turing machines

Bit-shifting example


3 7 diagram

3.7 Diagram


Fall 2010 exam 2 question 1

Fall 2010 Exam 2 Question 1

1) (25 pts) Give the full, formal description of a Turing Machine that accepts the following language:

L = { w#wR | where w consists of only 0s and 1s and has length at least 1. }

The input alphabet will be {0, 1, #}.

The tape alphabet will include 0, 1, #, B, and any other symbols you choose to include in it.

Give a simple intuitive description of what each state in the machine represents. And draw the diagram for this machine.


Simulator

Simulator

  • Accepts 4 or 5 tuples

    • (Start,input,NewState,output,Direction)

    • (Start,input,NewState,Direction OR output)

  • One tape

  • http://ironphoenix.org/tril/tm/


Turing machines

END


  • Login