In this seminar, we want to get to know computational thinking.
Carpenter (1836)
Lovelace describes an algorithm to compute Bernoulli numbers in her notes to Babbage’s lecture notes in 1842.
Lovelace (1842)
It is considered to be the first published algorithm ever specifically tailored for implementation on a computer.
Lovelace (1842)
Algorithms are finite sequences of instructions,
typically used
to solve specific problems.
Algorithms
Programs
Let’s look at some dead simple programs.
Such systems are called Finite-state automata (FSA)
finite-state machines,
finite automata,
or simply state machines.
An FSA is an abstract machine that can be in
exactly one
of a finite number of states at any given time.
FSA can change from one state to another in response to inputs.
Finite-state automata have
https://commons.wikimedia.org/wiki/File:Turnstile_state_machine_colored.svg
That is a state diagram.
Nodes (circles) represent states, edges (arrows) represent transitions from one state to another.
Goddard
(2024)
FSA enable automation.
Develop a state diagram
Inspirations: Apple Sorting Machine, Useless Machine, Whack a Mole
Time: 30 minutes
Let’s summarize!
https://commons.wikimedia.org/wiki/File:ASRock_K7VT4A_Pro_Mainboard.jpg
Today’s computers are based on the von Neumann model often implemented using a x86-64 architecture.
https://commons.wikimedia.org/wiki/File:AMD_Opteron_146_Venus,_2005.jpg
At it’s core, they deal with 0 and 1.
Imagine a Modern CPU. Every bit in a machine can only be in two states (0 or 1).
Therefore, there are a finite number of possible states.
In addition, when considering the parts of a computer a CPU interacts with, there are a finite number of possible inputs from the computer’s mouse, keyboard, hard disk, different slot cards, etc.
As a result, one can conclude that a CPU can be modeled as a finite-state machine.
Aziz, Cackler, and Yung (2004)
Is a modern computer a finite-state machine?
Now, consider a computer.
Although every bit in a machine can only be in two different states (0 or 1), there are an infinite number of interactions within the computer as a whole.
It becomes exceeding difficult to model the workings of a computer within the constraints of a finite-state machine.
However, higher-level, infinite and more powerful automata would be capable of carrying out this task.
Aziz, Cackler, and Yung (2004)
The first “infinite” model of computation
was conceived by Alan Turing.
It is known as the Turing machine.
https://en.wikipedia.org/wiki/File:Turing_Machine_Model_Davey_2012.jpg
The difference to FSA lies in the capability of a Turing machine to change symbols on its tape thereby simulating computer execution and storage.
It can be said that the Turing Machine has the power to model all computations that can be calculated today through modern computers.
Aziz, Cackler, and Yung (2004)
There are two major limitations in the analogy between Turing machines and modern PCs:
Let’s move from states and programs to algorithms.
Remember, algorithms are
Algorithms are much like a cooking recipe
Escape the maze!
Develop a general strategy to find a path from the red entrance to the green exit.
Do not ask ChatGPT 😜
If you are an experienced programmer, you can think about
implementing
your strategy in python. Please check out this
framework!
Time: 45 minutes
What is your strategy?
Translating the general strategy
Translate your general strategy in program code. Use this set of functions to have your agent take the corresponding action:
move()
to move your agent forwardturnLeft()
and turnRight()
to turn your
agentcanMove()
to tell you’re blocked by a wallvisitedBefore()
to tell you if you have visited a path
beforeisExit()
which tells you if you have reached the
exitIs there any other functionality you need?
If you are an experienced programmer, you can implement
your
strategy in python using this
framework!
Time: 45 minutes
Were you able to translate your strategy?
Were you missing some functionality?
What was your approach?