Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Turing Machine A definition of computability by Noah Richards.

Similar presentations


Presentation on theme: "The Turing Machine A definition of computability by Noah Richards."— Presentation transcript:

1 The Turing Machine A definition of computability by Noah Richards

2 Computability In the 1930s, mathematicians were looking for a definition of what it means to be able to compute a function. They came up with: A function is computable if it can be computed by a Turing machine.

3 What is a Turing Machine? Invented by Alonzo Church and Alan Turing, it is an incredibly simple machine with all of the power of any digital computer.

4 Parts of a Turing Machine 1) An infinite tape that is bi-directional and made up of squares containing a symbol from a finite alphabet. It contains only finitely many non-blank squares on the tape.

5 Parts, cont. 2) A read/write head positioned at some square on the tape. 3) A finite number of internal states at which it can be at exactly one at any given time.

6 Using a Turing Machine The general form of instruction for a touring machine is: (current_state, current_symbol, new_state, new_symbol, left/right)

7 Using, cont. An example of this is: (s1, 1, s2, 0, R) This means when the machine is in state s1 and reads a 1, it transfers to state s2, writes a 0 (to the same cell), and moves to the right one cell

8 Multiply Lets assume we want to write a program to multiply two numbers. We define this function as: multiply(n1, n2) = n1 * n2 As per common Turing convention, we will be representing numbers in unary (strings of 1s) separated by spaces (_s)

9 Heres the code: Multiply function Turing Machine code Step by step output for the multiply function

10 Virtual Turing Machine This code was created and run on the Virtual Turing Machine Virtual Turing Machine

11 Other sources of information The Turing Machine, written in JavaScriptThe Turing Machine, written in JavaScript with examples in unary addition, divisibility, and primality testing You guessed it: a Turing Machine written in schemea Turing Machine written in scheme

12 Moral of this story: Enjoy writing code in Scheme and Haskell. After all, you could be writing it for a Turing Machine.


Download ppt "The Turing Machine A definition of computability by Noah Richards."

Similar presentations


Ads by Google