Turing machine
This presentation is the property of its rightful owner.
Sponsored Links
1 / 88

Turing Machine PowerPoint PPT Presentation


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

Turing Machine. CSE-501 Formal Language & Automata Theory Aug-Dec,2010. ALAK ROY. Assistant Professor Dept. of CSE NIT Agartala. The Language Hierarchy. ?. ?. Context-Free Languages. Regular Languages. Languages accepted by Turing Machines. Context-Free Languages.

Download Presentation

Turing Machine

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 machine

Turing Machine

CSE-501

Formal Language & Automata Theory

Aug-Dec,2010

ALAK ROY.

Assistant Professor

Dept. of CSE

NIT Agartala


The language hierarchy

The Language Hierarchy

?

?

Context-Free Languages

Regular Languages


Turing machine

Languages accepted by

Turing Machines

Context-Free Languages

Regular Languages


A turing machine

A Turing Machine

Tape

......

......

Read-Write head

Control Unit


The tape

The Tape

No boundaries -- infinite length

......

......

Read-Write head

The head moves Left or Right


Turing machine

......

......

Read-Write head

The head at each time step:

1. Reads a symbol

2. Writes a symbol

3. Moves Left or Right


Turing machine

Example:

Time 0

......

......

Time 1

......

......

1. Reads

2. Writes

3. Moves Left


Turing machine

Time 1

......

......

Time 2

......

......

1. Reads

2. Writes

3. Moves Right


The input string

The Input String

Input string

Blank symbol

......

......

head

Head starts at the leftmost position

of the input string


Turing machine

Input string

Blank symbol

......

......

head

Remark: the input string is never empty


States transitions

States & Transitions

Write

Read

Move Left

Move Right


Turing machine

Example:

Time 1

......

......

current state


Turing machine

Time 1

......

......

Time 2

......

......


Turing machine

Example:

Time 1

......

......

Time 2

......

......


Turing machine

Example:

Time 1

......

......

Time 2

......

......


Determinism

Determinism

Turing Machines are deterministic

Not Allowed

Allowed

No lambda transitions allowed


Partial transition function

Partial Transition Function

Example:

......

......

Allowed:

No transition

for input symbol


Halting

Halting

The machine haltsif there are

no possible transitions to follow


Turing machine

Example:

......

......

No possible transition

HALT!!!


Final states

Final States

Allowed

Not Allowed

  • Final states have no outgoing transitions

  • In a final state the machine halts


Acceptance

Acceptance

If machine halts

in a final state

Accept Input

If machine halts

in a non-final state

or

If machine enters

an infinite loop

Reject Input


Turing machine example

Turing Machine Example

A Turing machine that accepts the language:


Turing machine

Time 0


Turing machine

Time 1


Turing machine

Time 2


Turing machine

Time 3


Turing machine

Time 4

Halt & Accept


Turing machine

Rejection Example

Time 0


Turing machine

Time 1

No possible Transition

Halt & Reject


Infinite loop example

Infinite Loop Example

A Turing machine

for language


Turing machine

Time 0


Turing machine

Time 1


Turing machine

Time 2


Turing machine

Time 2

Time 3

Infinite loop

Time 4

Time 5


Turing machine

  • Because of the infinite loop:

    • The final state cannot be reached

    • The machine never halts

    • The input is not accepted


Formal definitions for turing machines

Formal Definitionsfor Turing Machines


Turing machine

Transition Function


Turing machine

Transition Function


Turing machine

Turing Machine:

Input

alphabet

Tape

alphabet

States

Transition

function

Final

states

Initial

state

blank


Configuration

Configuration

Instantaneous description:


Turing machine

Time 4

Time 5

A Move:


Turing machine

Time 4

Time 5

Time 6

Time 7


Turing machine

Equivalent notation:


Turing machine

Initial configuration:

Input string


The accepted language

The Accepted Language

For any Turing Machine

Initial state

Final state


Standard turing machine

Standard Turing Machine

The machine we described is the standard:

  • Deterministic

  • Infinite tape in both directions

  • Tape is the input/output file


Computing functions with turing machines

Computing FunctionswithTuring Machines


Turing machine

A function

has:

Result Region:

Domain:


Turing machine

A function may have many parameters:

Example:

Addition function


Turing machine

We prefer unary representation:

easier to manipulate with Turing machines

Integer Domain

Decimal:

5

Binary:

101

Unary:

11111


Turing machine

Definition:

A function is computable if

there is a Turing Machine such that:

Initial configuration

Final configuration

initial state

final state

For all

Domain


Turing machine

In other words:

A function is computable if

there is a Turing Machine such that:

Initial

Configuration

Final

Configuration

For all

Domain


Example

Example

is computable

The function

are integers

Turing Machine:

Input string:

unary

Output string:

unary


Turing machine

Start

initial state

The 0 is the delimiter that

separates the two numbers


Turing machine

Start

initial state

Finish

final state


Turing machine

The 0 helps when we use

the result for other operations

Finish

final state


Turing machine

Turing machine for function


Turing machine

Execution Example:

Time 0

(2)

(2)

Final Result


Turing machine

Time 0


Turing machine

Time 1


Turing machine

Time 2


Turing machine

Time 3


Turing machine

Time 4


Turing machine

Time 5


Turing machine

Time 6


Turing machine

Time 7


Turing machine

Time 8


Turing machine

Time 9


Turing machine

Time 10


Turing machine

Time 11


Turing machine

Time 12

HALT & accept


Another example self study

Another Example – SELF STUDY

is computable

The function

is integer

Turing Machine:

Input string:

unary

Output string:

unary


Turing machine

Start

initial state

Finish

final state


Turing machine

Turing Machine Pseudocode for

  • Replace every 1 with $

  • Repeat:

  • Find rightmost $, replace it with 1

  • Go to right end, insert 1

Until no more $ remain


Turing machine

Turing Machine for


Turing machine

Example

Start

Finish


Turing machine

Block Diagram

Turing

Machine

input

output


Turing s thesis

Turing’s Thesis


Turing machine

Turing’s thesis:

Any computation carried out

by mechanical means

can be performed by a Turing Machine

(1930)


Turing machine

Computer Science Law:

A computation is mechanical

if and only if

it can be performed by a Turing Machine

There is no known model of computation

more powerful than Turing Machines


Turing machine

Definition of Algorithm:

An algorithm for function

is a

Turing Machine which computes


Turing machine

Algorithms are Turing Machines

When we say:

There exists an algorithm

We mean:

There exists a Turing Machine

that executes the algorithm


Construct a turing machine

Construct a Turing Machine:

  • Construct a TM to accept the set L of all strings over {0,1} ending with 010.


Can a tm simulate a tm

Can a TM simulate a TM?

Yes, obviously.

Can one TM simulate every TM?


An any tm simulator

An Any TM Simulator

Input: < Description of some TM m, w >

Output: result of running m on w

Universal

Turing

Machine

m

Output Tape

for running

TM- m starting on tape w

w


Universal turing machine utm

Universal Turing Machine (UTM)

  • functional notation of UTM:

    U(“m”“w”) = “m(w)”

  • takes 2 arguments:

    • m : a description of a Turing Machine TM

    • w : description of an input string w

  • have 2 properties:

    • UTM halts on input “m” “w” if & only if TM halts on input “w”.


Halting problem

Halting Problem


Thank you

Thank you


  • Login