Algorithm
Algorithm
algorithm?
Algorithm (noun):
In programming, algorithms are a set of step-by-step
instructions that tell a computer precisely what steps to take
to solve a problem or reach a goal. They are very much like a
recipe.
An algorithm has a well defined
sequence of steps, it gives you an
output, and it will eventually
terminate.
1 2 3 4 5 6
1 2 3 4 5 6
An algorithm is to solve a specific
problem or a class of problems.
algorithm
Pseudo-codes flowcharts
Pseudo-codes
It is intended for human reading rather than machine
reading.
the robot can’t dip the knife into the jar of peanut butter as the lid is still on
This algorithm (another name for a set of instructions) was not detailed enough. Let’s try again!
Algorithm example
Imagine that you are in the kitchen with your new pet robot. Your robot has a simple computer
brain – it needs to be told exactly how to make a peanut butter sandwich for you. This process
must be broken down into simple tasks for the robot to perform.
It runs into trouble in the final step as the bread is still in its packet and cannot spread it.
Let’s try again!
Algorithm example
This final algorithm looks detailed enough to allow the robot to make a peanut butter sandwich and
give it to its owner.
We are going to do a:
Let’s make
our first Human
algorithm! Robot
Treasure
Hunt
• Discover how to write and
follow algorithms.
Charm
We are going to :
Now it’s
time to
share your • Share your algorithm and
experiences
adventures!
• Discuss common
challenges and how
they were overcome