Computational thinking is a set of problem-solving approaches that express solutions in a way that a computer (or human) can understand and execute. It is not about coding — it is about thinking clearly and systematically about problems. The four key aspects are:
This lesson focuses on abstraction and decomposition — the two most foundational aspects.
Abstraction is the process of removing or hiding unnecessary detail while keeping the information relevant to the problem being solved. It allows programmers and engineers to focus on what matters for a given level of analysis.
Abstraction appears in two related but distinct forms in computer science:
Choosing what information to keep and what to discard when creating a model. Example: a road map abstracts away the width of roads, the colour of houses, and the texture of pavements — it keeps only the information needed for navigation.
Grouping related items under a common category to create general-purpose solutions. Example: a function (subroutine) is an abstraction — you don't need to know how it works internally; you just call it and use the result.
| Level | Description | Example |
|---|---|---|
| Problem Level | Real-world problem being solved | Navigating a city |
| Design Level | Algorithm / data structure design | Dijkstra's shortest path algorithm |
| Program Level | High-level language code | Python: graph.shortest_path() |
| OS/Language Level | Runtime environment, compiler | Python runtime, garbage collector |
| Hardware Level | Machine code, CPU instructions | MOV, ADD assembly instructions |
| Physics Level | Transistors, logic gates | CMOS gates, electrons |
At each level, the details below are abstracted away. A Python programmer doesn't need to know about MOV instructions; a hardware engineer doesn't need to know about Python syntax.
Decomposition is the process of breaking down a complex problem into smaller, simpler sub-problems that can be solved independently. The solutions are then combined to solve the original problem.
Decomposition is essential because:
Consider building a school management system. Decomposed into:
| Sub-problem | Further decomposed |
|---|---|
| Student management | Register, enroll, grade, attendance, report |
| Staff management | Timetabling, payroll, performance review |
| Timetable system | Clash detection, room allocation, subject assignment |
| Finance system | Fees, payments, budget tracking |
| Communication | Notifications, parent portal, announcements |
Each sub-problem is further decomposed until it reaches a level that can be programmed directly as a function or module.
Top-down design (also called stepwise refinement) is the systematic process of decomposition: start with the overall problem at the top, break it into sub-problems, then break each sub-problem further until you reach atomic tasks that can be coded directly. Represented as a structure chart (hierarchical diagram).
Decomposition drives modular programming — each sub-problem becomes a function/module. Benefits: team collaboration (divide modules between developers), code reuse (same module used in multiple places), easier testing (test each module independently), and maintenance (update one module without affecting others).
These two techniques work hand-in-hand. Decomposition breaks the problem into parts. Abstraction determines what each part needs to know about the others (the interface) and hides what it doesn't (the implementation). Together they are the foundation of software engineering.
8 questions · 22 marks · instantly marked
| Term | Definition |
|---|