2.1 – Algorithms

πŸŽ‡2.1.1 Computational thinking

This section covers:

  • Principles of computational thinking:

    • Abstraction

    • Decomposition

    • Algorithmic thinking

🏠 Click here to go back to the main page.

Other sections in this topic:

πŸ”—2.1.2 Designing, creating and refining algorithms

πŸ”—2.1.3 Searching and sorting algorithms

Introduction

In this unit, we will learn about computational thinking, which is, quite literally, thinking like a computer does and learning how to solve problems by breaking them down into simple and logical stages. Some people are naturally good at solving problems, but everyone can practice and become better at it.

Abstraction

One of the key skills of effective problem solving is abstraction. Basically, abstraction involves ignoring unnecessary details and keeping the essential detail that is needed to correctly solve the problem.

A good example of abstraction can be seen on the road signs in the UK.

Many roads, especially in a large town or city, are very complicated and it can be confusing for motorists who may not be familiar with the roads. If the road signs included too much detail, the motorist couldn't possibly take in all of the information without them getting distracted and possibly causing an accident. By stylising the signs and a consistent use of colour and symbols, the motorist is presented with the essential information that they need.


Road signs take away details that the driver doesn't need to see, whilst keeping the essential information.

Some roads are very complicated!

There are 270 stations shown on this map, and it appears that they have all been carefully and evenly laid out.

In reality, the stations are very close to each other in central London, but much further apart on the outskirts of London.

The London Tube map is another good example of abstraction. The London Underground was the first underground railway and currently has 270 stations and 250 miles of track divided into eleven different "lines" or routes. Harry Beck drew the first map in 1931, and his creation became very popular because it allows all users to find their way through this incredibly complex system. The map is constantly being updated but its iconic graphics are instantly recognisable, and it has been copied in many cities around the world.

Once again, colour is used to help the user and the map has been carefully laid out to make it easier to find your station and journey. The actual layout of the stations is very different - two stations may be close together on the map but are actually a long distance apart and may be deep underground or part of the surface railway.

Decomposition

When we solve problems, both with and without a computer, we need to break down the overall problem into smaller, simpler ones which can be solved more easily. Decomposition means breaking down of large problems into smaller problems.

  • Smaller problems are easier to solve.

  • They can be created independent of the other problems.

  • They can be tested independently.

  • The smaller solutions can then be combined to produce the full solution.

  • There is not always one right answer. A problem could be decomposed in several valid ways.

We all do this as part of our everyday life. When faced with an everyday problem, such as "get ready to go out", we would decompose the problem down into smaller ones:

  • Are we dressed appropriately?

  • Do we need money?

  • Do we need food, or do we need to eat first?

  • Have you told everyone who needs to know where we are going?

  • Have you got your phone and keys?

When people solve a Rubik's cube, they break the problem down into smaller problems - solve the first face, solve the middle sections, etc.


Algorithmic Thinking

An algorithm is a set of rules that must be followed that will carry out a task. The rules must usually be followed in the correct order, and may contain items which will only be carried out under certain circumstances.

For your GCSE Computing, you need to know about several "standard" algorithms. The first two are used to search a list of items for one that meets certain criteria, and the next three are different ways of sorting a list of items into order.