Presentation is loading. Please wait.

Presentation is loading. Please wait.

P.V.G’s College of Engineering, Nashik

Similar presentations


Presentation on theme: "P.V.G’s College of Engineering, Nashik"— Presentation transcript:

1 P.V.G’s College of Engineering, Nashik
Department of Information Technology Class: T.E. Subject: Theory of Computation Turing Machine Prof.Harshal N.Kolhe Prof.H.N.Kolhe 1

2 Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely (mathematically). Examples: Adding two numbers in our brains, on a piece of paper or using a calculator. Converting a decimal number to its binary presentation or vise versa. Finding the greatest common divisors of two numbers. 2

3 Theory of Computation A very fundamental and traditional branch of Theory of Computation seeks: A more tangible definition for the intuitive notion of algorithm which results in a more concrete definition for computation. Finding the boundaries (limitations) of computation. 3

4 Algorithm A finite sequence of simple instructions that is guaranteed to halt in a finite amount of time. This is a very abstract definition, since: We didn’t specify the nature of this simple instructions. For example an instruction can be “increment a number by one” or “Calculate the triple integral” We didn’t specify the entity which can execute these instructions. For example is this entity a person, a computer, … If it is a computer what is the processor type? How much memory does it have? …. ? 4

5 Turing Machine A conceptual model for general purpose computers proposed by Alan Turing in 1936. A Turing machine has an unlimited and unrestricted amount of memory. A Turing machine can do everything a real computer can do. Nevertheless there are problems that a Turing machine cannot solve. In a real sense, these problems are beyond the theoretical limits of computations. 5

6 Turing Machine Specification
Components of Turing Machine: An unlimited length tape of discrete cells. A head which reads and writes on tape. A control device with a finite number of states which can Instruct the head to read the symbol on the tape currently under head. Instruct the head to write a symbol on the cell of the tape currently under tape. Move the head one cell to left or right. Change its current state. 6

7 A Turning Machine 7

8 Turing Machine Instructions
Instructions of Turing Machine have the following format: (Current State, Current Symbol, Write, Move L/R or No move, New State) Ex: (2, 0, 1, L, 3) (3, 1, blank, N, 4) (1, #, 0, R, 7) 8

9 Turing Machine Instructions
The interpretation of the TM (Turing Machine) instructions: (2, 0, 1, L, 3) When Turing machine (the control unit of TM) is at state 2 and the current tape symbol is 0, write symbol 1 at current tape cell and go to state 3. 9

10 Visualization of TM instruction (2, 0, 1, L, 3)
10

11 Visualization of TM instruction (2, 0, 1, L, 3)
11

12 TM Conventions We always use state 1 as the initial state. (That is the execution of the algorithm or program begins with stating of the TM being 1. The tape is used for recording input and output, one symbol per cell. Initially, the string to serve as input to our computation is recorded beginning from the leftmost tape cell. Initially, the position of head is at left most cell. 12

13 Initial Configuration of TM
13

14 The Output of TM The output of a TM program or algorithm is the sequence of symbols on the tape when the TM halts on that program. 14

15 TM Programs A Turing machine program is a set of TM instructions.
Turing machine halts on a program if there is no instruction in the program which its current state is the current state of the machine and its current symbol is the current symbol of the tape of the machine (symbol under head of the machine). 15

16 Example 2 {(1, 0, 0, R, 2), (1, 1, 1, R, 2), (2, 0, 0, R, 2), (2, 1, 1, R, 2), (2, blank, 0, R, 3), (3, blank, 0, R, 4 )} Number of states: 4 Used alphabet : 0, 1 16

17 Example 2 1 1 0 0 1 0 1 1 b b b … state = 1 ^ (1, 0, 0, R, 2)
(2, blank, 0, R, 3) (3, blank, 0, R, 4 ) 17

18 Example 2 1 1 0 0 1 0 1 1 b b b … state = 2 ^ (1, 0, 0, R, 2)
(2, blank, 0, R, 3) (3, blank, 0, R, 4 ) 18

19 Example 2 1 1 0 0 1 0 1 1 b b b … state = 2 ^ (1, 0, 0, R, 2)
(2, blank, 0, R, 3) (3, blank, 0, R, 4 ) 19

20 Example 2 1 1 0 0 1 0 1 1 b b b … state = 2 ^ (1, 0, 0, R, 2)
(2, blank, 0, R, 3) (3, blank, 0, R, 4 ) 20

21 Example 2 1 1 0 0 1 0 1 1 b b b … state = 2 ^ (1, 0, 0, R, 2)
(2, blank, 0, R, 3) (3, blank, 0, R, 4 ) 21

22 Example 2 1 1 0 0 1 0 1 1 b b b … state = 2 ^ (1, 0, 0, R, 2)
(2, blank, 0, R, 3) (3, blank, 0, R, 4 ) 22

23 Example 2 1 1 0 0 1 0 1 1 b b b … state = 2 ^ (1, 0, 0, R, 2)
(2, blank, 0, R, 3) (3, blank, 0, R, 4 ) 23

24 Example 2 1 1 0 0 1 0 1 1 b b b … state = 2 ^ (1, 0, 0, R, 2)
(2, blank, 0, R, 3) (3, blank, 0, R, 4 ) 24

25 Example 2 1 1 0 0 1 0 1 1 b b b … state = 2 ^ (1, 0, 0, R, 2)
> (2, blank, 0, R, 3) (3, blank, 0, R, 4 ) 25

26 Example 2 1 1 0 0 1 0 1 1 0 b b … state = 3 ^ (1, 0, 0, R, 2)
(2, blank, 0, R, 3) > (3, blank, 0, R, 4 ) 26

27 Example 2 b … state = 4 ^ (1, 0, 0, R, 2) (1, 1, 1, R, 2) (2, 0, 0, R, 2) (2, 1, 1, R, 2) (2, blank, 0, R, 3) (3, blank, 0, R, 4 ) 27

28 Example 2 HALT. Output: 1 1 0 0 1 0 1 1 0 0 b … state = 4 ^ INPUT:
What is the function that is being computed by this program? 28

29 Example 2 OUTPUT: 1100101100 INPUT: 11001011
Input is base-2 presentation of number 203 and output is the base-2 presentation of number 812. 29

30 Example 2 OUTPUT: 1100101100 INPUT: 11001011
Input is base-2 presentation of number 203 and output is the base-2 presentation of number 812. Thus, f(x) = 4x 30


Download ppt "P.V.G’s College of Engineering, Nashik"

Similar presentations


Ads by Google