Lesson 1 · Computational thinking

🧠 Computational Thinking

Before you write a program, you think like a computer scientist: break the problem down, spot patterns and keep only what matters.

🧩 Decomposition and patterns

Decomposition means breaking a big problem into smaller parts that are easier to solve. Pattern recognition means spotting things that are the same or repeat, so you can solve them once and reuse the answer.

problem: make a school quiz game parts: questions, checking answers, keeping score, showing the result pattern: every question is asked and checked the same way

🖼️ See it

Computational thinkingDecompositionbreak it into partsPatternsspot what repeatsAbstractionkeep what mattersAlgorithmwrite the stepsSolve aproblem
Planning a quiz game: split it into questions, checking and scoring; ask every question the same way; ignore details like shirt colour.

🗺️ Abstraction

Abstraction means hiding the details you do not need and keeping the ones that matter. A metro map is an abstraction: it shows the stations and the order they come in, not every street and building.

quiz game: keep the question, the answer and the score leave out: the colour of the player’s shirt, the time of day
Think before you code. A few minutes of decomposition saves a lot of debugging later.

🪜 Step by step: using abstraction

Abstraction means keeping only the details that matter.

Problem: design a map of the underground. What do you keep?

  1. List what a traveller needs. Stations, lines and connections.
  2. List what they don't need. Exact distances and street names.
  3. Draw only the useful detail.

Answer: a simple diagram of stations and lines.

Remember: abstraction hides detail you don't need.
✏️ Quick check · 1 of 6
Decomposition

Decomposition means:

De-compose: take apart.
✏️ Quick check · 2 of 6
Abstraction

Abstraction means:

Think of a simple map.
✏️ Quick check · 3 of 6
Pattern

Spotting that every level of a game works the same way is:

Something repeats.
✏️ Quick check · 4 of 6
Map

A metro map shows stations but not streets. This is an example of:

What has been left out?
✏️ Quick check · 5 of 6
Parts

Which is the best way to decompose “plan a class party”?

Smaller jobs.
✏️ Quick check · 6 of 6
Detail

For a program that adds up test scores, which detail is NOT needed?

Does it change the total?
📝 Lesson quiz · 5 questions
0 / 5
Re-read the lesson, then give it another go.
Question 1 of 5

Which is decomposition?

Question 2 of 5

A recipe that repeats “stir for 1 minute” five times shows a:

Question 3 of 5

Which is an abstraction of a car for a racing game?

Question 4 of 5

Computational thinking happens:

Question 5 of 5

Why is decomposition useful?