You are on page 1of 16

Quantitative

Thinking
Tutorial 4

Algorithm to make a cup of tea


Write down a list
of instructions for
making a cup tea
This may require
1,21000
instructions

Algorithm to make a cup of tea


Who has the
shortest algorithm?

Algorithm to make a cup of tea


Who has the
shortest algorithm?
Who has the
longest?

Algorithm to make a cup of tea


Who has the
shortest algorithm?
Who has the
longest?
What is the
difference between
these?

Algorithm to make a cup of tea


Who has the shortest
algorithm?
Who has the longest?
What is the difference
between these?
Precision,
assumptions made
about the reader?

Algorithms
Computers are the
stupidest imaginable
readers of instructions
But can execute simple
instructions very well (and
quickly)

Algorithms
Computers are the
stupidest imaginable
readers of instructions
But can execute simple
instructions very well (and
quickly)
These simple instructions
however can lead to
interesting emergent
behaviours if repeated
lots of times

Conways Game of Life


https://www.youtube.com/watch?v=CgOcEZinQ2I
Not really a game
Cellular automaton: using a grid we apply rules to
observe and measure the effects of the rules (with no
interaction beyond setting it up and setting the rules)
These effects can be relatively complex (emergent
complexity) given very simple rules
They are used to understand very complex questions
such as how the diversity of life evolved on Earth

Life: Rules
Each cell
has 8
neighbours
Each cell can be
alive (occupied)
or dead
(unoccupied)
A post-it note
shows alive

If unoccupied cell
has 0-1
neighbours, dies
(loneliness)
If unoccupied cell
has 4-8
neighbours, dies
(overcrowding)
If occupied cell has
2-3 neighbours,
stays alive

Emergent Patterns
I will put up a combinations
of (3 and 4) live and dead
cells on one grid
A person at a time will
come up and go cell by cell
checking if should be alive
or dead (adding them to
the other grid)
Repeat
Watch out for emerging
and/or recurring patterns

Blinker

Beehive

Emergent Patterns (if more


boards)
In groups of 2-3, pick a
Tetris shape (3 or 4 live
cells)
Then follow the Life rules
One person must keep note
of all changes
I want you to get a
beehive!
If feeling adventurous
start with a glider:

Glider

Blinker

Beehive

Life: Rules
Each cell
has 8
neighbours
Each cell can be
alive (occupied)
or dead
(unoccupied)
A post-it note
shows alive

If unoccupied cell
has 0-1
neighbours, dies
(loneliness)
If unoccupied cell
has 4-8
neighbours, dies
(overcrowding)
If occupied cell has
2-3 neighbours,
stays alive

Algorithms
How did you all get on?
Anyone make any
mistakes?

Algorithms
How did you all get on?
Anyone make any
mistakes?
Humans are terrible at
precisely following
algorithms, thats what we
have computers for!

When running
this code
(which you will
do on Friday!),
the computer
methodological
ly and
perfectly (if
programmed
correctly) goes
through each

You might also like