Thinking Like a Computer Scientist

Can you add up all the whole numbers from 1 to 100 (1 + 2 + 3 + … + 100) in less than a minute, without a calculator? It sounds impossible. The story goes that a young boy named Carl Friedrich Gauss did it in his head over 200 years ago, and he grew up to be a famous mathematician. By the end of this post, you will be able to do it too.

In this post:

  • What computational thinking is
  • Its four skills: decomposition, pattern recognition, abstraction and algorithms
  • Writing an algorithm as a story (a narrative algorithm)
  • Solving the 1 to 100 puzzle, a sorting activity, an ordering activity and a quiz

What is computational thinking?

Computational thinking is a way of solving problems that computer scientists use, but it works for any problem: homework, games, planning a party or fixing a bike. It has four main skills:

SkillWhat it meansEveryday example
DecompositionBreaking a big problem into smaller parts that are easier to solveCleaning your room: clothes first, then books, then the floor
Pattern recognitionSpotting things that are the same or repeatNoticing that every Monday you forget your PE kit
AbstractionFocusing on the important details and ignoring the restA maxi-taxi route map shows the stops, not every tree and house
AlgorithmA clear set of step-by-step instructions to solve the problemA recipe for pelau

Narrative algorithms

An algorithm doesn’t have to be code. A narrative algorithm tells the steps in plain words, in order, like a story: “First, fill the kettle. Next, switch it on. While the water boils, put a tea bag in a cup. When the kettle clicks off, pour the water into the cup…” Words like first, next, while, when and until make the order clear.

Using all four skills: 1 + 2 + … + 100

An animation that starts with the question 1 + 2 + 3 + … + n = ?, then arranges coloured blocks in a staircase, copies the staircase, turns it upside down and fits the two together to make a rectangle.
An animated picture proof. Two copies of the staircase 1 + 2 + … + n fit together into a rectangle that is n wide and n + 1 tall, so one staircase is half the rectangle.

Image source: File:Animated proof for the formula giving the sum of the first integers 1+2+…+n.gif (Wikimedia Commons)

  1. Decomposition: instead of one giant sum, pair the numbers up: the first with the last, the second with the second-last, and so on.
  2. Pattern recognition: 1 + 100 = 101. 2 + 99 = 101. 3 + 98 = 101. Every pair adds up to 101!
  3. Abstraction: we don’t need to add each pair. We only need two facts: each pair makes 101, and there are 100 ÷ 2 = 50 pairs.
  4. Algorithm: multiply: 50 × 101 = 5050. The same steps work for any list from 1 up to an even number: take half the last number, and multiply it by (the last number + 1).

Watch: what is computational thinking?

This short video from The Tech Interactive, a science and technology museum, explains what computational thinking is.

Video: What is Computational Thinking? – The Tech Interactive – https://www.youtube.com/watch?v=NEBRe_EULiY

Activity: use the pattern

Try it: number puzzles

Use the pairing pattern to answer each question. Type your answer and click Check.

1. What is 1 + 2 + 3 + … + 10?

2. What is 1 + 2 + 3 + … + 20?

3. How many pairs are there when you add 1 to 100?

4. What is 1 + 2 + 3 + … + 100?

5. What is 2 + 4 + 6 + … + 20?

Activity: which skill?

Try it: name the skill

Drag or tap each card into the skill it shows.

A map of the school that shows only the classrooms and exits
Ignoring the colour of the car when working out how far it travelled
Seeing that the bus is always late when it rains
Splitting a school project into research, writing and making the poster
A recipe for making bake
Noticing that every pair from 1 to 100 adds up to 101
Writing numbered steps for how to log on to a school computer
Planning a party by sorting out food, music and invitations separately

Decomposition

Pattern recognition

Abstraction

Algorithm

Activity: a narrative algorithm

Try it: brushing your teeth

Put the steps of this narrative algorithm in order, then click Check.

▲ First

  1. First, wet your toothbrush.
  2. Next, squeeze a small amount of toothpaste onto it.
  3. Then brush every tooth, front and back, for about two minutes.
  4. When you have finished, spit out the toothpaste.
  5. After that, rinse your mouth and your toothbrush.
  6. Finally, put the toothbrush back in its holder.

▼ Last

Self-check quiz

Click the best answer. You get feedback straight away; only your first click counts towards your score.

1. Breaking a big problem into smaller parts is called…

2. Focusing on the important details and ignoring the rest is called…

3. An algorithm is…

4. What is 1 + 2 + 3 + … + 100?

5. A narrative algorithm is written…

6. Noticing that every Monday the canteen sells out of doubles is an example of…

Related posts on islandclass.org

Next: Scratch: Paint a Sprite and Draw an Image

Syllabus link: Forms 1–3 ICT curriculum, Module 5, Objective 5.4 – employ computational thinking skills to solve simple problems.

Attributions to media used in this post:

Updates

2026/10/21

- Fixed the activity code so its buttons keep working.

© 2026 Vedesh Kungebeharry. All rights reserved.

Leave a Reply