Introduction
What is an algorithm?
An algorithm is a set of unambiguous, step-by-step instructions used to solve a problem. They are used by both human beings and computers.
For example, imagine you have a bag of colored blocks, and you want to find a specific block, let’s say a blue block, in the bag. Here’s a simple algorithm you can follow:
- Take out one block from the bag.
- Check if the block is blue.
- If it is blue, you found the block! Yay! Stop searching.
- If it’s not blue, put the block aside and go back to step 1.
- Repeat steps 1-4 until you find the blue block.
In this example, the algorithm is a series of steps that helps you find the blue block. You repeat the steps until you find what you’re looking for.
Computers are really good at following algorithms, even much more complex ones. They can solve problems much faster than humans because they can follow instructions very quickly.
Algorithms for Humans
Common examples of algorithms for humans include:
Computers
Algorithms for Computers
Computers require algorithms to function and these usually come in the form of software. Computers differ from humans in that the instructions provided must completely unambiguous – they must be clear and not open to interpretation.
Computer Algorithms used in computers are usually written in text or block based programming languages such as Python or Scratch, though some algorithms are physically wired into a computer.
Thinking
Thinking Algorithmically
Thinking algorithmically is a systematic and structured approach to problem-solving and decision-making. It involves breaking down complex tasks or issues into smaller, well-defined steps or procedures, much like a recipe for cooking or a set of instructions for assembling a piece of furniture.
This methodical approach enables individuals to solve problems, make decisions, and complete tasks in an organized and efficient manner.
Algorithmic thinking is rooted in the principles of computer science and mathematics, where algorithms are used to solve a wide range of problems. However, its applicability extends well beyond the realm of technology.
Video
Video – What is an algorithm?
Activity 1
Write an Algorithm Activity
Choose one of the the following and write an algorithm for it:
- How to make your favourite food
- Your favourite viral Tik-tok dance
- How to make a paper plane
- How to make a cup of tea for a room full of people
- Drawing a picture of a house
Activity 2
Activity 2 – Alien shopping algorithm
An alien has landed on earth and you have decided to send him on an important mission – to do your weekly shopping down at the supermarket! You have been given a shopping list. The alien has never been shopping before – can you write a set of instructions for it to do the shopping for you?
Remember!
Your algorithm must be:
- Step-by-step.
- Unambiguous – Each step must be completely clear and specific.