Presentation on theme: "The Turing Machine A definition of computability by Noah Richards."— Presentation transcript:
The Turing Machine A definition of computability by Noah Richards
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.
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.
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.
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.
Using a Turing Machine The general form of instruction for a touring machine is: (current_state, current_symbol, new_state, new_symbol, left/right)
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
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)
Heres the code: Multiply function Turing Machine code Step by step output for the multiply function
Virtual Turing Machine This code was created and run on the Virtual Turing Machine Virtual Turing Machine
Moral of this story: Enjoy writing code in Scheme and Haskell. After all, you could be writing it for a Turing Machine.
Your consent to our cookies if you continue to use this website.