Professional Documents
Culture Documents
Todays lecture
Course website:
http://www.loria.fr/~blackbur/courses/math
Roman abacus
c
INRIA
The Chinese abacus was first mentioned around 190 AD. They
became widely used around 1200 AD. Note the two rows of
count 5 beads.
c
INRIA
c
INRIA
The Japanese adopted the abacus from the Chinese around the
fifteenth or sixteenth century. They dropped one of the row of
the count 5 beads, yielding the modern Soroban abacus, still
used in modern Japan.
Areces, Blackburn, Figueira: Mathematics for Computer Science
c
INRIA
Inca abacus
c
INRIA
Gottfried Leibniz
c
INRIA
c
INRIA
The Turk
Charles Babbage
c
INRIA
c
INRIA
c
INRIA
Geeks rule!
Areces, Blackburn, Figueira: Mathematics for Computer Science
c
INRIA
c
INRIA
The input was to have been via punched cards (such cards
were already being used in mechanical looms).
The reason for Babbages failure to finish the machine was his
all-consuming enthusiasm for a more general project (closer to a
modern computer) that he called the Analytical Engine.
Areces, Blackburn, Figueira: Mathematics for Computer Science
c
INRIA
c
INRIA
This is the only part of the Analytical Engine which was ever
built. Called the mill, which did the four basic arithmetic
operations, comparisons, and square roots.
Areces, Blackburn, Figueira: Mathematics for Computer Science
c
INRIA
Practical computing
c
INRIA
c
INRIA
c
INRIA
How we calculate
c
INRIA
Columbia Machine
c
INRIA
c
INRIA
c
INRIA
c
INRIA
Turing machines
c
INRIA
c
INRIA
Reading
$
x
#
$
#
Write
$
c
INRIA
InState
1
1
1
2
2
Turings analysis
...
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
The head moves along the tape from left to right, and
changes every x it finds to a $ (that is, it overwrites
every x with a $ symbol).
c
INRIA
Turn Xs to Dollars!
...
Example input
$ x
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
...
Move
R
L
L
R
InState
1
1
1
2
2
NewState
1
1
2
2
3
c
INRIA
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
Configuration 1
What to do. . . ?
$ x
InState
1
1
1
2
2
And heres some typical input. What happens next? Well, lets
assume we start in State 1
...
$ x
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
$ x
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
c
INRIA
There!
Configuration 2
...
$
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
InState
1
1
1
2
2
c
INRIA
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
What to do. . . ?
There. . . !
$
InState
1
1
1
2
2
...
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
c
INRIA
Configuration 3
...
What to do. . . ?
$
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
$
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
c
INRIA
There!
Configuration 4
...
$
InState
1
1
1
2
2
$ $
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
InState
1
1
1
2
2
c
INRIA
$ $
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
$
InState
1
1
1
2
2
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
$ x
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
c
INRIA
Configuration 5
What to do. . . ?
$
InState
1
1
1
2
2
Reading
$
x
#
$
#
There!
$
...
$ $
What to do. . . ?
InState
1
1
1
2
2
...
$ x
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
InState
1
1
1
2
2
$ x
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
c
INRIA
There!
Configuration 6
...
$
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
InState
1
1
1
2
2
c
INRIA
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
$
InState
1
1
1
2
2
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
c
INRIA
Configuration 7
What to do. . . ?
$
InState
1
1
1
2
2
Reading
$
x
#
$
#
There
$
...
What to do. . . ?
InState
1
1
1
2
2
...
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
$
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
c
INRIA
There!
Configuration 8
...
$
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
c
INRIA
What to do. . . ?
...
There!
$
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
InState
1
1
1
2
2
c
INRIA
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
c
INRIA
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
Configuration 11
Configuration 12
$
$ $
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
$
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
c
INRIA
Configuration 13
Configuration 14
$ $
InState
1
1
1
2
2
...
$
InState
1
1
1
2
2
InState
1
1
1
2
2
Reading
$
x
#
$
#
Configuration 10
$
...
Configuration 9
InState
1
1
1
2
2
...
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
NewState
1
1
2
2
3
c
INRIA
c
INRIA
Configuration 13
...
Configuration 13
$ $
InState
1
1
1
2
2
Reading
$
x
#
$
#
Write
$
...
Move
R
L
L
R
...
NewState
1
1
2
2
3
InState
1
1
1
2
2
c
INRIA
c
INRIA
I
I
I
I
I
I
c
INRIA
L
L
R
NewState
1
1
2
2
3
c
INRIA
c
INRIA
c
INRIA
Monadic addition
...
Move
R
Write
...
Representing numbers
I
Reading
$
x
#
$
#
Summing up
I
$ $
1
InState
1
1
2
2
3
3
4
4
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
NewState
1
2
2
3
3
4
4
5
c
INRIA
Example input
...
Configuration 1
1
InState
1
1
2
2
3
3
4
4
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
...
NewState
1
2
2
3
3
4
4
5
InState
1
1
2
2
3
3
4
4
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
...
NewState
1
2
2
3
3
4
4
5
c
INRIA
...
Move
R
R
L
L
L
R
NewState
1
2
2
3
3
4
4
5
c
INRIA
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
NewState
1
2
2
3
3
4
4
5
c
INRIA
Configuration 4
Configuration 5
1
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
...
NewState
1
2
2
3
3
4
4
5
1
InState
1
1
2
2
3
3
4
4
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
NewState
1
2
2
3
3
4
4
5
c
INRIA
Configuration 6
Configuration 7
1
InState
1
1
2
2
3
3
4
4
Write
...
1
InState
1
1
2
2
3
3
4
4
InState
1
1
2
2
3
3
4
4
Reading
1
#
1
#
1
#
1
#
Configuration 3
1
...
Configuration 2
InState
1
1
2
2
3
3
4
4
...
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
...
NewState
1
2
2
3
3
4
4
5
InState
1
1
2
2
3
3
4
4
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
NewState
1
2
2
3
3
4
4
5
10
c
INRIA
Configuration 8
...
Configuration 9
1
InState
1
1
2
2
3
3
4
4
Reading
1
#
1
#
1
#
1
#
Write
1
Move
R
R
L
...
L
L
R
...
NewState
1
2
2
3
3
4
4
5
InState
1
1
2
2
3
3
4
4
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
...
NewState
1
2
2
3
3
4
4
5
Write
1
...
Move
R
R
L
L
L
R
NewState
1
2
2
3
3
4
4
5
c
INRIA
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
NewState
1
2
2
3
3
4
4
5
c
INRIA
Configuration 12
Configuration 14
1
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
...
NewState
1
2
2
3
3
4
4
5
1
InState
1
1
2
2
3
3
4
4
1 1
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
NewState
1
2
2
3
3
4
4
5
c
INRIA
Configuration 15
Configuration 16
1
InState
1
1
2
2
3
3
4
4
c
INRIA
...
1
InState
1
1
2
2
3
3
4
4
InState
1
1
2
2
3
3
4
4
Reading
1
#
1
#
1
#
1
#
Configuration 11
1
...
Configuration 10
InState
1
1
2
2
3
3
4
4
...
1 1
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
...
NewState
1
2
2
3
3
4
4
5
InState
1
1
2
2
3
3
4
4
1 1
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
NewState
1
2
2
3
3
4
4
5
11
c
INRIA
Configuration 17
...
InState
1
1
2
2
3
3
4
4
Configuration 18
1
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
...
NewState
1
2
2
3
3
4
4
5
InState
1
1
2
2
3
3
4
4
1 1
Reading
1
#
1
#
1
#
1
#
Write
1
...
Move
R
R
L
L
L
R
NewState
1
2
2
3
3
4
4
5
c
INRIA
c
INRIA
R
L
L
L
R
NewState
1
2
2
3
3
4
4
5
c
INRIA
Odd state: if you read a blank, write odd and halt. If you
read a 1, move right, and go into the even state.
c
INRIA
Odd or even?
Example input
1
InState
1
2
2
3
3
Move
R
The Algorithm
...
Write
...
A decision problem
Remarks
Reading
1
#
1
#
1
#
1
#
Configuration 18
InState
1
1
2
2
3
3
4
4
...
1 1
Reading
1
#
1
#
1
1
Write
even
...
...
Move
R
odd
R
R
InState
1
2
2
3
3
NewState
3
4
3
5
2
Reading
1
#
1
#
1
1
Write
even
...
Move
R
odd
R
R
NewState
3
4
3
5
2
And heres some typical (even) input. Ready to go. . . blah blah
blah
blah blah blah
c
INRIA
12
c
INRIA
Configuration 1
...
Configuration 2
1 1
InState
1
2
2
3
3
Reading
1
#
1
#
1
...
Write
even
Move
R
R
odd
...
NewState
3
4
3
5
2
InState
1
2
2
3
3
Reading
1
#
1
#
1
...
Write
even
Move
R
R
odd
...
NewState
3
4
3
5
2
1
InState
1
2
2
3
3
...
Write
even
Move
R
R
odd
NewState
3
4
3
5
2
c
INRIA
Reading
1
#
1
#
1
...
Write
even
Move
R
R
odd
NewState
3
4
3
5
2
c
INRIA
c
INRIA
Configuration 5
Configuration 6
1
InState
1
2
2
3
3
Reading
1
#
1
#
1
Configuration 4
1
...
Configuration 3
InState
1
2
2
3
3
c
INRIA
...
Reading
1
#
1
#
1
...
Write
even
Move
R
odd
R
R
...
NewState
3
4
3
5
2
InState
1
2
2
3
3
Were in the even state. But now we are seeing a blank square.
So we know that the input was an even number. So we write
even on the tape and go into State 4 blah blah blah
Areces, Blackburn, Figueira: Mathematics for Computer Science
Reading
1
#
1
#
1
...
even
Write
even
Move
R
odd
R
R
NewState
3
4
3
5
2
c
INRIA
Remarks
c
INRIA
Summary of Lecture 3
Key concepts:
I
c
INRIA
13
c
INRIA
Key concepts:
I
I
Key concepts:
c
INRIA
14
c
INRIA