Lesson 2: Algorithms
What are algorithms?
An algorithm is a sequence of instructions or a set of rules to get something done. They can be found all around us in day to day life.
|
|
|
Here is a short video that explains algorithms
Comparing everyday tasks that humans do using algorithms and how an app uses algorithms in its program.
What are algorithms in digital technologies?
If we want to tell a computer to do something, we have to write a computer program that will:
- tell the computer, step-by-step, exactly what we want it to do, and
- how we want it to do it.
This step-by-step program will need planning, and to do this we use an algorithm.
To start to write an algorithm we need to know what the final output needs to be. We also need to decide on what inputs will trigger the output.
Think about a toaster as a technological system. Think about its inputs and outputs. What are the steps needed to create and eat some toast? Spend some time thinking about these questions and try to construct a list of steps in your mind.
Sequential instructions using decomposition
In the ‘draw toast’ task you have learned how to break a large task down into small bite size chunks and have thought about the logical sequence of instructions - what did you need to do first, second, third, etc. You may have noticed:
-
Although everyone’s drawings are all different, they are all fundamentally correct. There are many ways to decompose a problem and there is no real “right” or “wrong.”
-
The drawings may be different in content, they tend to be similar in structure. In the task the sequential instructions tend to contain three to seven drawings, connected by lines or arrows.
Exact Instruction Challenge
Algorithms in digital technologies
Algorithms are often used as a starting point for creating a computer program, and they are sometimes written as a flowchart or in pseudocode. A simple program represented in pseudocode would look like this:
OUTPUT 'What is your name?'
INPUT user inputs their name
STORE the user's input in the name variable
OUTPUT 'Hello' + name
OUTPUT 'How old are you?'
INPUT user inputs their age
STORE the user's input in the age variable
IF age >= 70 THEN
OUTPUT 'You are aged to perfection!'
ELSE
OUTPUT 'You are a spring chicken!'
The same program represented in a flowchart would look like this.

What makes a successful algorithm?
- Decomposing a large task and abstracting unnecessary elements
- Sequencing tasks into steps
- Understanding importance of the order of the steps
- Recognising and using patterns
- Using Iteration - repeats or loops
- Debugging problems
Test your knowledge!
Test your knowledge of this lesson and submit your response to show proof of completion.