theory of automata by:imran ul haq :2424 zeshan ali:2416 ali usman :2436

32
Theory of Automata By: Imran ul haq: 2424 Zeshan Ali: 2416 Ali Usman: 2436 Sakhawat Ali: 2411 Mudassar Salfi: 2427 Turing machines

Upload: zahina

Post on 13-Feb-2016

39 views

Category:

Documents


0 download

DESCRIPTION

Turing machines. Theory of Automata By:Imran ul haq :2424 Zeshan Ali:2416 Ali Usman :2436 Sakhawat Ali:2411 Mudassar Salfi :2427 . Origin of Turing machines. Theory of Turing Machines first introduced by Alan Matheson Turing and Emil Post in 1930s and 1940s . . - PowerPoint PPT Presentation

TRANSCRIPT

Theory of Automata

By: Imran ul haq: 2424

Zeshan Ali: 2416

Ali Usman: 2436

Sakhawat Ali: 2411

Mudassar Salfi: 2427

Turing machines

• Theory of Turing Machines first introduced by Alan Matheson Turing and Emil Post in 1930s and 1940s.

• Turing Machines are those ultimate model for computer , that must have output capabilities .

• Out put is very important , because a program with no output

statements mighty seem totally useless because it would never convey to humans the calculation ‘s results.

ORIGIN OF TURING MACHINES

• 1:- In his obituary of Turing 1955 Newman writes: To the question ‘what is a “mechanical” process?’

• 2:- Turing returned the characteristic answer ‘something that can be done by a machine’.

Alan Turing’s A-machine

• 1:- He told that the ‘main idea;. The main idea might have either been his analysis of computation or his realization

• 2:- Turing stated that ‘a function is affectively calculable if its value can be found by some purely mechanical process’.

• 3:-The Germen secret codes created by encryption machines called “The Enigma”.

• 4:- If one is to ask for a general procedure to tell us: “Does this machine ever print 0”, the question is “undecidable”.

GANDY STATES

• 1:- in 1937 Turing built a digital multiplier from scratch, making his own electromechanical relays.

• 2:- Alan task was to embody the logical design of a Turing machine in a network relay- operated switches.

The digital computer

• 1:-In particular , computational complexity theory makes use of the Turing machine.

• 2: Two models have obtained a dominant position in machine-based complexity theory.

The Turing machine as a model of computation

A Turing Machine denoted TM , is a collection of Six things.

1: An alphabet ∑ of input letters ,which for clarity's sake does not contain the blank symbol Δ.2: A TAPE divided into a sequence of numbered cells, each containing one character or blank.The input word is presented to the machine one letter per cell beginning in the leftmost cell, the remaining cells of TAPE are initially filled with blanks Δ’s. Cell i cell ii cell iii cell iv cell v

⌂ Tape Head

DEFINITION OF TM

3: A TAPE HEAD that can in one step read the contents of a cell on the TAPE , replace it with some other character and reposition itself to the next cell to the RIGHT or to the LEFT of the one it has just read.At the start of processing ,the TAPE HEAD always begins by reading the input in cell i . The TAPE HEAD can never move left from cell i ,if it do so

machine will be crash. The location of TAPE HEAD is indicated by ⌂.

4: An alphabet Γ of characters that can be printed on TAPE by TAPE HEAD. This can include ∑. However the TAPE HEAD can print a Δ, this is called Erasing and do not include Blank as a letter in the alphabet Γ.

5: A finite set of states including START with which we will begin execution and may be re-enter in it during execution and some HALT states that cause execution to terminate when we enter them. Other states have no function only names as …..1,2,3 or q1, q2, q3.

6: A program which is a set of rules that tell us on the basis of the states we are in and the letter the TAPE HEAD has just read , how to change states, what to print on the TAPE and where to move the TAPE HEAD .We depict a program as a collection directed edges connecting the states. Each edge is labeled with a Triplet information: ( letter, letter, Direction )

• First letter is indicating READING of a character from Γ, ∑ and may be Δ.

• Second letter is indicating PRINTING of a character which has read last time by TAPE HEAD ,before it leaves .

• Third component tells the TAPE HEAD whether to move one cell to right R or one cell to left L.

( letter, letter, Direction )

Reading of a character

Printing of a character Instruction for TAPE HEAD To move RIGHT or LEFT

By definition all TM are DETERMINISTIC . This means that there is no state q that has two or more edges leaving it labeled with same first letter.

For example…..

q1

q2

q3( a , b , L )

( a, a, R ) This is notAllowed in TM

for example following is the TAPE from a TM about to run on the input aba.

a b a Δ Δ i ii iii iv v vi

⌂ Start 1 2 3 HALT 4

(a, a, R) (b,b,R) (Δ,Δ,R)

(a, a, R)(b, b, R)

This is the program for this TM as a directed graph with labeled edges.

WORKING OF TURING MACHINE

a b a Δ Δ

We can show execution process in simple four steps.• First , we start always with the TAPE HEAD reading cell i and

the program in the start.

⌂We can show it as 1 aba at this point TAPE HEAD follow the edge (a, a, R ) . The instruction of this edge to the TAPE HEAD are “ read an a, print an a, move Right.”

i ii iii iv v

a b a Δ Δ

• Secondly ,we are in state 2 ,where TAPE HEAD reads b in cell ii .we must take the ride to state 3 on the labeled (b, b, R).

Now the TAPE look like this: i ii iii iv v

we can record the execution process by writing : 1 2 aba aba

The above digits shows the present state on which we are. And the underline letter is the letter which reads last time.

a b a Δ Δ

i ii iii iv v

• Thirdly ,after following label (b, b, R) the TAPE HEAD replaces the b with ab And moves right one cell.The TAPE now look like this:

in other sense we are now up to 1 2 3 aba aba abawe are in state 3 reading an a, so we loop that means we stay in state 3 but we move The TAPE HEAD to cell iv. 3 4 aba abaΔ This is the reason to indicating a Δ as a meaningful part of TM.

• At fourth stage ,now we are on state 3 reading a Δ. So we move to state 4:

3 4 aba∆ abaΔΔThe input string aba has been accepted by TM .because this machine does not change any letter on the TAPE.

This all execution can be shown by execution chain also called process chain or trace of execution or simply a trace. 1 2 3 4 HALT aba aba aba abaΔ

The word “state” used in context of

Turing machine can be a source of

confusion, as it can mean two things. Most commentators

after Turing have used "state" to mean the

name/designator of the current instruction to

be performed

THE “STATE”

THE “STATE”• But Turing (1936) made a strong distinction between

record of what he called the machine's "m-configuration",

(its internal state) and the machine's (or person's) "state

of progress" through the computation - the current state

of the total system. What Turing called "the state formula"

includes both the current instruction and all the symbols

on the tape

THUS THE STATE OF PROGRESS OF THE COMPUTATION AT

ANY STAGE IS COMPLETELY DETERMINED BY THE NOTE

OF INSTRUCTIONS AND THE SYMBOLS ON THE TAPE. THAT

IS, THE STATE OF THE SYSTEM MAY BE DESCRIBED BY A

SINGLE EXPRESSION (SEQUENCE OF SYMBOLS)

CONSISTING OF THE SYMBOLS ON THE TAPE FOLLOWED

BY Δ AND THEN BY THE NOTE OF INSTRUCTIONS. THIS

EXPRESSION IS CALLED THE 'STATE FORMULA'.

Tape symbol

Current state A

Current state B

Current state C

Write symbol

Move tape

Next state

Write symbol

Move tape

Next state

Write symbol

Move tape

Next state

0

P

R

B

P

L

A

P

L

B

1

P

L

C

P

R

B

P

R

HALLT

Turing machine "state“ diagrams

LIMITATION OF TURING MACHINE

• A limitation of Turing machines is that they do not model the strengths of a particular arrangement well.

• RASP.• the RASP has an infinite number of distinguishable, numbered but

unbounded registers memory "cells" that can contain any integer.• The RASP's finite-state machine is equipped with the capability for

indirect addressing .• when Turing machines are used as the basis for bounding running times,

a 'false lower bound' can be proven on certain algorithms' running times.

COMPUTATIONAL COMPEXITYTHEORY

• real machine can only be in finitely may configurations.• Turing machines are equivalent to machines that have an

unlimited amount of storage space for their computations.• Turing machines are not intended to model computers, but

rather they are intended to model computation itself.

COMPARISON WITH REAL MACHINE

WHY TURING MACHINES ARE

USEFUL MODELS OF REAL COMPUTERS

Any thing a real computer can compute, a Turing machine can also compute. For example: “A Turing machine can simulate any type of subroutine found in programming languages, including recursive procedures and any of known parameter-passing mechanisms” A large enough FSA can also model any real computer , disregarding IO. Thus , a statement about the limitations of Turin machines will also apply to real Computers

The difference lies only with the ability of a Turing machine to manipulate an unbounded amount of data. However, given a finite amount of time, a Turing machine (like a real machine) can only manipulate a finite amount of data

Like a Turing machine, a real machine can have its storage space enlarged as needed, by acquiring more disks or other storage media. If the supply of these runs short, the Turing machine may become less useful as a model. But the fact is that neither Turing machines nor real machines need astronomical amounts of storage space in order to perform useful computation. The processing time required is usually much more of a problem.

Descriptions of real machine programs using simpler abstract models are often much more complex than descriptions using Turing machines. For example, a Turing machine describing an algorithm may have a few hundred states, while the equivalent deterministic finite automaton on a given real machine has quadrillions. This makes the DFA representation infeasible to analyze.

Turing machines describe algorithms independent of how much memory they use. There is a limit to the memory possessed by any current machine, but this limit can rise arbitrarily in time. Turing machines allow us to make statements about algorithms which will (theoretically) hold forever, regardless of advances in conventional computing machine architecture.

for example following is the TAPE from a TM about to run on the input aba.

i ii iii iv v via b a Δ Δ

Turing machines simplify the statement of algorithms. Algorithms running on Turing-equivalent abstract machines are usually more general than their counterparts running on real machines, because they have arbitrary-precision data types available and never have to deal with unexpected conditions (including, but not limited to, running out of memory.

One way in which Turing machines are a poor model for programs is that many real programs, such as operating systems and word processors, are written to receive unbounded input over time, and therefore do not halt. Turing machines do not model such ongoing computation well (but can still model portions of it, such as individual procedures).

CONCLUSION