B1.1 Approaches to Computational Thinking
Revision notes. Everything in the syllabus, nothing extra.
Computational thinking is a way of approaching a problem so that its solution can be carried out by a computer. It rests on four concepts:
| Concept | In one line |
|---|---|
| Decomposition | Break a big problem into smaller parts. |
| Pattern recognition | Spot similarities so one solution can be reused. |
| Abstraction | Remove unnecessary detail, keep what matters. |
| Algorithmic design | Write clear step by step instructions to solve it. |
B1.1.1: Problem Specification
A problem specification defines exactly what must be solved before anyone starts solving it. It has six parts. Every part must be clear, specific and measurable.
| Part | What it says | Weak | Strong |
|---|---|---|---|
| 1. Problem statement | What the problem is and why it matters. Concise, specific, no ambiguity. | "Our customer service is inefficient." | "Customers wait an average of 25 minutes on hold, causing a 15% rise in abandoned calls last quarter." |
| 2. Constraints and limitations | Restrictions on the solution: resources (time, budget, staff), technical (hardware, software), external (laws, other systems). | "We don't have many resources." | "The budget is limited to $10,000 and cannot be exceeded due to funding rules." |
| 3. Objectives and goals | Objective: broad, high level aim. Goals: specific, measurable, time limited targets that achieve it. | "Make customers happier." | Objective: reduce wait times. Goal: cut average hold time by 20% within the next quarter. |
| 4. Input specification | The format, type and expected characteristics of the data going in. | "Customer feedback." | Star ratings 1 to 5, free text comments and NPS scores, collected straight after the interaction and linked to the customer. |
| 5. Output specification | The format, content and presentation of the results coming out. | "Some reports." | A dashboard with weekly satisfaction charts, filterable by date and channel, plus alerts for very negative feedback. |
| 6. Evaluation criteria | The benchmarks used to judge whether the solution worked. | "It works well." | The chatbot resolves 70% of enquiries without a human and scores 4/5 on post chat surveys. |
NPS (net promoter score) rates how likely a customer is to recommend the company to a friend.
Evaluation criteria: the five factors
| Factor | Question | Chatbot example |
|---|---|---|
| Effectiveness | Does it solve the problem? | % of enquiries resolved without a human |
| Efficiency | Does it save time or resources? | Faster resolution, available 24/7, less load on staff |
| Accuracy | Are the results correct? | Correct answers, understands different phrasings of the same request |
| Usability | Is it easy to use? | Simple interface, clear prompts, little training needed |
| Maintainability | Can it be updated and adapted? | New questions or channels can be added easily, data kept safe |
- Learn the six parts in order: Statement, Constraints, Objectives and goals, Inputs, Outputs, Evaluation.
- If it can't be measured, it's not a good goal. Numbers plus a time limit.
- Goals become your evaluation criteria at the end. This is exactly how your IA works.
B1.1.2: The Four Concepts
Decomposition
- Single responsibility principle (SRP): each part should do one clear job.
- Ask: Can it be split into steps or phases? Are there repeated parts to group? Which parts are independent? What does a diagram of it look like? Could I explain it to a five year old (ELI5)?
- Examples: a bicycle into frame, drivetrain, wheels, steering, brakes, seat, gears, suspension, lights, fenders. A smartphone into screen, battery, charging circuit, CPU, RAM, storage, buttons, ports, cameras, sensors, OS.
| Decomposing a game NPC (non playing character) | |
|---|---|
| Sensing | Perceive the player and surroundings (sight, hearing). |
| Decision making | Evaluate the situation and choose an action (behaviour tree, finite state machine). |
| Actions | Patrol, attack, flee, hide. |
| Pathfinding | Navigate the world to reach a goal. |
The textbook also shows a deeper split: motivation (goals, personality), perception (sensory input, filtering), decision making (behaviour library, evaluation module), action execution (animation, movement). Both are valid. Decomposition keeps going until each part is simple.
Pattern recognition
- Ask: What is repeated? How do things change over time? Do different parts do the same job? Could specific values be replaced with variables?
- Example 1: 2, 4, 6, 8. Each number is 2 more than the last, so
next = current + 2. One rule predicts any term. - Example 2: handwritten digits. An image is a grid of pixel brightness values. A "1" is a vertical line, an "8" is two loops, so any shape with a loop is likely 0, 6, 8 or 9.
Abstraction
- The hard part: deciding what is essential. A car's engine matters, its colour doesn't.
- Ask: What is the core purpose? What are the minimum inputs and outputs? If I remove this part, does it still work? Can several steps become one higher level idea?
| Predicting a winner | Keep | Ignore |
|---|---|---|
| Football match | Serious injuries, past results between the teams | Shoelace colour, probably player age |
| Car race | Car performance (engine, tyres, aerodynamics), driver skill, track suitability, weather, chance of mechanical failure | Car colour, driver's favourite snack, cloud shapes |
The race model becomes a few scores out of 10 plus failure chances. It is a simplification, but a useful one. That is the essence of abstraction.
Algorithmic design
- Ask: What exactly is the problem? What are the inputs? What are the outputs? Where are the decisions? Where are the loops? What is the order of steps?
- Can be written as code, pseudocode or a flowchart.
- Test: explain it step by step to a friend. If they get stuck, a step is missing.
B1.1.3: Applying Computational Thinking
In an "explain how" question, go through all four concepts and give one specific example of each in the scenario.
| Field | Decomposition | Pattern recognition | Abstraction | Algorithmic design |
|---|---|---|---|---|
| Software development (CRM system) | Modules: lead tracking, customer management, communication | Recording common bugs to speed up future debugging | OOP objects with reusable methods | Exact rules and steps for automatic email scheduling |
| Data analysis (sales data) | Cleaning, normalisation, analysis | Seasonal sales trends to predict demand | Focus on KPIs, filter out irrelevant data | ETL pipeline: extract, transform, load |
| Machine learning | Data collection, features, training, evaluation, deployment | Finding image features that classify objects (CNNs) | Data represented as features and labels | Network design: layers, activation functions, optimiser |
| Database design | Conceptual, logical, physical stages | Common queries, so index or denormalise for them | Tables that model real entities, ignore irrelevant detail | Efficient querying, updating, transactions for integrity |
| Network security | Physical, infrastructure, application security | Known attack patterns (DDoS, phishing) | Generic security models and protocols | Encryption algorithms and protocols (TLS) |
B1.1.4: Tracing Flowcharts
A flowchart is a diagram that shows the steps, decisions and flow of control of an algorithm using standard symbols (ISO 5807). It is read top to bottom, left to right.
- Decision: exactly two exits, labelled Yes/No or True/False. The question inside must have only those two answers.
- Process: changes the value, form or location of data.
- Connector: joins parts of a big flowchart without drawing a long line.
How to trace
- Draw a trace table: one column per variable, one for each decision, one for output.
- Follow the arrows exactly. Write a new row every time a value changes.
- At every diamond, work out the condition with the current values and follow that exit.
- Stop at End. Check the last pass, where the decision finally flips. Off by one mistakes live there.
Example 1: a simple decision
Example 2: a loop (guess the number)
The "No" path loops back to the input, so the player keeps guessing until the decision becomes "Yes".
Example 3: linear search
Checks every element in turn from index 0 until it finds the target or reaches the end. Array: 2, 4, 6, ... 100. Target: 42.
42 sits at index 20, so the loop checks indexes 0 to 20 and outputs "Found at 20" after 21 comparisons. Searching for 43 would check all 50 elements, then output "Not found".
Example 4: how many iterations?
| Iteration | A | B | A > B? |
|---|---|---|---|
| start | 10 | 100 | No |
| 1 | 20 | 90 | No |
| 2 | 30 | 80 | No |
| 3 | 40 | 70 | No |
| 4 | 50 | 60 | No |
| 5 | 60 | 50 | Yes → End |
5 iterations. The loop body runs 5 times, but the decision is checked 6 times. Read the question carefully to see which one it asks for.
Practice
- Splitting a game into a menu screen, a play screen and a score screen.
- Ignoring a car's colour when predicting a race winner.
- Noticing three parts of a program all sort a list, so writing one sort function.
- Writing the exact steps for when an email reminder is sent.
"The school website is bad and students do not like it."
A school canteen has long queues at lunch.
Goals: cut the average queue time from 15 to 5 minutes by the end of term. Serve 90% of students within the first 20 minutes of lunch by January. Both are measurable and time limited.
Set x = 12 and y = 8. While x ≠ y: if x > y then x = x − y, otherwise y = y − x. When they are equal, output x.
| x | y | x ≠ y? | Action |
|---|---|---|---|
| 12 | 8 | Yes | x = 12 − 8 = 4 |
| 4 | 8 | Yes | y = 8 − 4 = 4 |
| 4 | 4 | No | Output 4 |
Set total = 0 and n = 1. While total < 20: total = total + n, then n = n + 2. Output total and n.
| Iteration | total | n | total < 20? |
|---|---|---|---|
| start | 0 | 1 | Yes |
| 1 | 1 | 3 | Yes |
| 2 | 4 | 5 | Yes |
| 3 | 9 | 7 | Yes |
| 4 | 16 | 9 | Yes |
| 5 | 25 | 11 | No |
- Four concepts: decomposition, pattern recognition, abstraction, algorithmic design. Break it, spot it, simplify it, solve it.
- Six spec parts: statement, constraints, objectives and goals, inputs, outputs, evaluation criteria.
- Objective = broad aim. Goal = measurable target with a deadline.
- Evaluation criteria: effectiveness, efficiency, accuracy, usability, maintainability.
- "Explain how computational thinking is applied" means all four concepts, each with an example from the scenario.
- Decision diamonds have exactly two exits. Label them.
- When tracing, use a table and check the last pass of every loop.