IB COMPUTER SCIENCE | B1.1.3 Applying Computational Thinking

Lesson objective

Explain how computational thinking helps approach and solve problems in software development, data analysis, machine learning, database design and network security.

Learn

B1.1.3 | APPLYING COMPUTATIONAL THINKING

01 | KNOWING THE WORDS IS ONLY THE START

You can define decomposition and still face a blank page when asked to solve a real problem. The next step is to use the concepts deliberately: decide what information matters, divide the work, look for useful similarities and develop a precise method.

This common SL/HL lesson applies abstraction, decomposition, pattern recognition and algorithmic design across software development, data analysis, machine learning, database design and network security. The examples are small enough to follow, but the reasoning also matters in larger projects.

You do not have to start by programming. A paper sketch, a table of data, a conversation about requirements or a step-by-step procedure can all be useful computational thinking.

02 | EXPLAIN THE LINK, NOT JUST THE LABEL

The IB command term explain asks you to give a detailed account including reasons or causes. An answer such as “use abstraction” identifies a concept but leaves the important reasoning unstated.

A stronger answer is: “Represent each loan using student and item identifiers because these distinguish the records needed for duplicate checks. Omit unrelated appearance details, reducing unnecessary complexity while preserving the information required by the rules.”

Build an explanation from concept → specific action → reason or effect. Connectives such as because, therefore, resulting in and so that can help, but they must link valid ideas rather than simply decorate a sentence.

03 | START WITH THE PROBLEM AND ITS CONSTRAINTS

Before choosing a technique, establish the required outcome. A school needs accurate equipment availability, not merely an app containing colourful buttons. Ask who uses the service, what data exists, which rules apply and what evidence would show improvement.

A problem specification guides the thinking. Abstraction must retain the data needed by the requirements. Decomposition should cover the required responsibilities. An algorithm must respect the constraints and handle the agreed cases.

If requirements are uncertain, record questions or assumptions. Computational thinking can organise a problem, but it cannot turn an invented policy into a confirmed user requirement.

04 | ONE TOOLKIT, MANY REPRESENTATIONS

Concept What you do Why it helps
Abstraction Choose relevant information and a representation suited to the task. Makes important relationships visible without losing required distinctions.
Decomposition Divide the problem into coherent smaller parts. Allows focused reasoning, development and testing.
Pattern recognition Find useful similarities or regularities and check exceptions. Suggests shared approaches and reusable rules.
Algorithmic design Specify precise ordered steps and decision rules. Makes the method repeatable, traceable and implementable.

The concepts interact. Tracing a method can reveal a missing field in the model; investigating a repeated task can suggest a reusable component. There is no compulsory four-step order that guarantees a good solution.

05 | SOFTWARE DEVELOPMENT: AN EQUIPMENT-LOAN SERVICE

A librarian wants to record loans and returns and find out whether an item is available. A student can borrow several different items, but each item can have at most one active loan. A loan is active until its return is recorded.

Abstraction represents the relevant world using StudentID, EquipmentID, LoanID, dates and loan state. A complete physical model of every item is unnecessary for checking whether it has an active loan. Removing EquipmentID, however, would destroy the distinction between different items.

This representation helps because the program can compare reliable identifiers and states rather than guess from repeated names or vague equipment descriptions.

06 | SOFTWARE: DIVIDE THE SERVICE AND REUSE THE CHECKS

Decompose the service into receiving a request, checking it, recording a loan or return, and displaying the result. Break checking down further into known identifiers, active-loan status and required dates. Each component has a focused job and can be checked with suitable cases.

Pattern recognition reveals that different item types share the same availability rule. A camera and a microphone can use a common loan procedure supplied with a different EquipmentID. This reduces duplicated logic and helps prevent the rules drifting apart.

Check the limits of reuse: a specialist item may require an additional safety approval. A common procedure must incorporate that condition where required rather than ignore it because most items do not need it.

07 | SOFTWARE: ORDER THE ACTIONS SAFELY

Algorithmic design turns those ideas into a method: receive identifiers; reject unknown values; reject an item with an active loan; create one loan; then confirm the result. Rejection leaves existing loans unchanged.

Checking before recording matters because saving first could create two active loans for one item. The method can be traced with an available item, an already-loaned item and an unknown ID to check different paths.

This small sequential model assumes one request is processed at a time. A real multi-user system needs an appropriate atomic operation or transaction to stop simultaneous requests taking the same item. The thinking exposes the issue; a diagram alone does not implement that protection.

08 | DATA ANALYSIS: WHICH DAY USES MORE ENERGY?

A school records electricity meter readings. It wants to compare daily energy use and investigate unusually high days. A meter reading is a cumulative total in kWh, not the amount consumed that day.

Abstraction keeps the reading date, time, meter identity and cumulative value. Decomposition separates checking the readings, calculating interval use, comparing valid days and presenting findings. Keeping units and timestamps matters because a difference spanning two days is not directly comparable with a one-day interval.

Pattern recognition may reveal higher consumption on busy weekdays. That suggests a question to investigate; it does not prove the timetable caused the difference. Temperature, holidays or equipment use could also contribute.

09 | DATA ANALYSIS: BUILD A METHOD THAT RESPECTS THE DATA

Date at the same reading time Cumulative meter reading / kWh Consumption since preceding reading
1 October 1200 Not available: no preceding reading
2 October 1230 30 kWh over one day
3 October 1275 45 kWh over one day
5 October 1345 70 kWh over two days; daily split unknown

Algorithmic design sorts readings for the same meter by timestamp, checks their validity, subtracts successive values and records the length of each interval. Mark the missing daily breakdown rather than pretending that 70 kWh belongs entirely to 5 October.

This produces a defensible comparison because each result retains its measurement interval. A two-day average of 35 kWh per day can describe that interval, but does not establish either individual day’s consumption.

10 | TRY THE MISSING-READING DECISION

A daily report requires readings exactly one day apart at the same time. Choose how the method handles the two-day gap. Predict the consequence before revealing the explanation.

11 | MACHINE LEARNING: PREDICT A DELIVERY DURATION

A delivery service wants to predict journey time before a journey begins. It has past delivery distances, numbers of stops and recorded durations. Machine learning can fit patterns from examples rather than requiring a person to write every predictive rule.

Abstraction represents a delivery using relevant input features such as distance and planned stops, with duration as the target to predict. Exact package decoration is unlikely to help this task. Actual arrival time is unavailable before the trip, so using it as an input would leak the answer.

Selecting a representation is consequential: missing important features can weaken predictions, while including inappropriate information can make evaluation look unrealistically good. More columns do not automatically mean a better model.

12 | MACHINE LEARNING: ORGANISE THE WORK AND TEST THE PATTERN

Decomposition separates defining the prediction task, checking records, separating data for development and evaluation, fitting a model, assessing predictions and monitoring its later use. These parts reveal where errors can enter.

Pattern recognition is central when a model learns relationships such as longer distances tending to require more time. However, a relationship learned from one area or season may not hold in another. Evaluate on suitable unseen examples rather than assuming that fitting past records establishes future reliability.

Algorithmic design specifies the workflow, including separating evaluation data before fitting preprocessing, using only information available at prediction time and reporting an appropriate error measure. The model’s learning procedure is also algorithmic; identifying a pattern alone does not establish causation or fairness.

13 | DATABASE DESIGN: REPRESENT THE RELATIONSHIPS

A library records members, books and loans. A member may borrow many books over time, and a book may be borrowed repeatedly. Storing one giant text description for each member makes reliable updates and searches difficult.

Abstraction identifies entities such as Member, BookCopy and Loan, then retains their relevant attributes and relationships. A Loan can refer to MemberID and CopyID, allowing different loans to be linked to the same member or physical copy without confusing them.

This helps because the representation matches the questions the library must answer. One book title can have several physical copies, so title alone is not an adequate identifier when deciding which particular copy is on loan.

14 | DATABASES: SEPARATE FACTS AND DEFINE OPERATIONS

Decomposition separates member details, physical-copy details and loan events into related tables. Repeated member names and contact details in many loan rows reveal a pattern of duplicated facts: changing a phone number in only some rows would create inconsistency.

Pattern recognition helps identify repeated structures and dependencies, but table design must follow actual rules. Two people sharing a name does not mean they are one member. Identifiers preserve the distinction.

Algorithmic design describes an operation such as recording a loan: check the member and copy, check availability, create the linked loan and commit the change together. Database constraints and transactions can enforce relevant rules; merely drawing separate tables does not guarantee integrity.

15 | NETWORK SECURITY: WHICH TRAFFIC NEEDS INVESTIGATION?

A school network team wants to identify unusual connection activity. Raw traffic contains large amounts of detail. For an initial connection-rate investigation, an abstraction might retain source identifier, destination, timestamp, protocol and event count rather than every payload byte.

Decomposition separates collecting authorised logs, preparing comparable time windows, detecting candidate anomalies, investigating context and deciding on a response. This allows detection to be tested separately from the consequences of blocking a device.

Pattern recognition can compare activity against an expected baseline. Repeated failed connections or a sudden rise may justify investigation. They do not by themselves prove malicious intent: a legitimate update, misconfiguration or teaching exercise can also produce unusual traffic.

16 | SECURITY: MAKE THE DECISION RULE EXPLICIT

Suppose a fictional classroom rule flags a source when it makes more than 20 failed connections in a five-minute window. Algorithmic design specifies the window, which events count, how they are grouped and what happens at the threshold.

The rule flags 21 failures but not 20. A flag creates a review task rather than automatically declaring an attack. Staff inspect authorised context before taking a proportionate action. This threshold is a teaching example, not a recommended security configuration.

The model must also preserve enough context for the purpose. Combining an entire school into one count could hide a single noisy source, while treating a shared address as one person could misattribute activity. Effective protection needs more than one simplified count rule.

17 | EXPLORE A THRESHOLD AND ITS TRADE-OFF

The fictional log sample below uses the same five-minute window for every source. Change the flag threshold and inspect the resulting review workload. Counts greater than the threshold are flagged; counts equal to it are not. No traffic is actually blocked.

Explain why a low threshold may produce more review work, while a high threshold may miss concerning activity. Without verified labels, this sample cannot tell you its false-positive rate or whether any flagged source is malicious.

18 | COMPARE THE APPLICATIONS

Area Useful abstraction Useful decomposition Pattern and method
Software IDs, states and required operations Receive, check, record, report Shared loan checks become a precise reusable procedure.
Data analysis Values, units and timestamps Prepare, calculate, compare, present Time patterns are investigated using a method that respects gaps.
Machine learning Prediction-time features and target Prepare, fit, evaluate, monitor Learn relationships and evaluate on appropriately held-out data.
Database design Entities, attributes and relationships Separate facts into related tables Repeated facts suggest consistency issues; operations preserve integrity.
Network security Relevant events and comparable windows Collect, detect, investigate, respond Unusual rates trigger an explicit review procedure, not proof of attack.

A good explanation connects the technique to the actual problem. Repeating the same generic sentence under every heading does not show why the representation or method is suitable.

19 | CHOOSE AN APPROACH FOR THE TASK

Not every problem requires machine learning, and computational thinking is broader than any one technology. A known capacity rule can be expressed directly with a comparison; a prediction task involving complex observed relationships may justify a learned model.

Start with a clear requirement and consider a simple adequate approach. A table and manual procedure may be enough for a tiny club; a larger service may need a database and automated checks. Complexity should have a reason.

Assess what evidence would change your choice. Increasing scale, simultaneous users or new reporting requirements can make an earlier solution unsuitable, leading you to revise the representation and decomposition.

20 | TEST, LEARN AND REVISE

Suppose the loan method passes tests with one staff member but fails when two staff members request the last available item at once. The failure reveals an assumption in the model and a missing operational requirement.

Revisit the decomposition and algorithm: the availability check and recording operation need appropriate coordination. Add tests for simultaneous requests. Similarly, a misleading energy chart can send you back to timestamps and interval rules.

Testing is not an activity performed only after all thinking is finished. Tracing, stakeholder feedback and test evidence can reveal weaknesses early and guide a better solution.

21 | A METHOD CAN BE PRECISE AND STILL BE WRONG

An algorithm that always rejects every loan is unambiguous and terminates, but does not meet the requirement to accept valid loans. A model trained using tomorrow’s arrival time might produce impressive numbers while being unusable before a journey.

Distinguish precision, correctness and suitability. Precision makes the method understandable; correctness concerns whether it follows the required rules under stated conditions; suitability also considers the context, constraints and effects.

Computational thinking supports good decisions but does not guarantee them. You must check assumptions, quality of evidence, meaningful exceptions and the impact on affected people.

22 | TURN A WEAK ANSWER INTO AN EXPLANATION

Weak answer Stronger explanation
Use decomposition for software. Separate request checking from saving, so invalid requests can be tested without changing records and saving occurs only after acceptance.
Use abstraction for data. Retain timestamps and units because a two-day energy difference cannot be treated as one day’s consumption.
Use patterns for security. Compare event rates in equivalent windows to identify unusual activity for review, while checking legitimate explanations before response.
Use algorithms for databases. Specify the sequence of checks and linked updates, and make the operation atomic where required so a partial change cannot leave inconsistent records.

Your answer need not force all four concepts into every sentence. Select the relevant concept, give a concrete action and explain the effect on the stated problem.

23 | YOUR TURN: THE CANTEEN PRE-ORDER SERVICE

Students pre-order one lunch per school day. Each meal option has a daily preparation limit. Staff need a preparation list, and students need confirmation. Requests are handled in recorded order. Changes and cancellations are not included in the first version.

Explain how abstraction, decomposition, pattern recognition and algorithmic design could help. Include the data required to prevent two orders for one student on one day, a check on meal capacity and one limitation or assumption.

Then explain how the approach changes if staff want to predict next week’s demand. Distinguish enforcing a known ordering rule from learning a prediction from historical data.

Reveal an explanation outline

Retain StudentID, meal date, MealID, daily meal limits and existing orders, because these support student/day uniqueness and per-meal/day capacity. Divide the work into receiving, checking, recording and producing outputs. Recognise that meal options share a capacity rule while allergy or eligibility requirements, if included, need explicit handling.

For one request, check known values, reject an existing order for that student/date, reject if that meal/date has reached its limit, otherwise record and confirm. The sequential assumption needs review for concurrent users. Forecasting is a separate prediction task: use appropriate historical and known-in-advance features, investigate patterns and evaluate forecasts on suitable later data rather than assuming the ordering checks predict demand.

24 | A PROBLEM-SOLVING TOOLKIT

Computational thinking can begin before a screen is opened: a librarian can sketch entities, a network team can agree a review procedure, and a teacher can compare data intervals on paper. Programming may automate the eventual method, but it is not a prerequisite for the reasoning.

To explain an application, connect the problem to the representation, smaller parts, useful regularities and precise steps. Show why these choices help, then recognise the assumptions and evidence needed to judge the result.

The next lesson develops tracing with flowcharts, allowing you to follow decisions and changes in values through an algorithm.

MATCH THE TECHNIQUE TO THE ACTION

Terminology

Terminology

Computational thinking

A toolkit for representing problems and developing systematic solutions, with or without programming.

Application

Use of a concept or technique in a specific problem context.

Abstraction

Representing relevant features while omitting unnecessary detail for a purpose.

Decomposition

Dividing a problem into smaller manageable parts.

Pattern recognition

Identifying useful similarities, repetitions or regularities.

Algorithmic design

Developing precise ordered steps and decision rules.

Requirement

A stated condition or outcome the solution must satisfy.

Constraint

A restriction on developing or operating a solution.

Assumption

Something provisionally treated as true that should be identified and checked.

Model

A representation of selected aspects of a situation.

Identifier

A value distinguishing an item or record in its intended context.

State

The current values or records relevant to an operation.

Component

A coherent part of a larger solution.

Reuse

Applying an existing suitable approach or component to another instance.

Exception

A case with a meaningful difference requiring additional handling.

Trace

Following steps using specific inputs and current values.

Test evidence

Observed results used to assess whether required behaviour occurs.

Cumulative reading

A running total, requiring a difference to measure use over an interval.

Measurement interval

The period over which a value or difference applies.

Feature

An input attribute used by a machine-learning model.

Target

The outcome a supervised model is trained to predict.

Data leakage

Use of information that should not legitimately be available when developing or evaluating a prediction.

Held-out data

Examples kept separate from fitting for an appropriate evaluation role.

Entity

A distinguishable type of thing represented in a database model.

Relationship

An association between represented entities or records.

Transaction

A logical unit of database work that can be committed or rolled back.

Atomic operation

An operation that takes effect as a whole rather than leaving a partial result.

Baseline

A reference pattern or level used for comparison.

Anomaly

An observation that differs from an expected pattern, without automatically proving harm.

Threshold

A boundary used by a decision rule.

Questions

Questions

CHECK YOUR UNDERSTANDING

Select all correct choices. Each exact set earns one point.

1. Which explain why computational thinking can precede programming?
2. Which support the loan-service abstraction?
3. Which explain the value of decomposition?
4. Which are justified uses of pattern recognition?
5. Which respect the energy-reading example?
6. Which are appropriate for predicting duration before a delivery?
7. Which help the library database?
8. Which follow the security demonstration?
9. Which recognise limitations?
10. Which make a strong explanation?

EXPLAIN AND COMPARE

Write your answers before revealing each sample.

1. Explain why computational thinking does not necessarily involve programming.

2. Explain how abstraction supports the equipment-loan service.

3. Explain how decomposition helps develop the loan service.

4. Explain how pattern recognition supports reuse without ignoring exceptions.

5. Explain why algorithmic design must consider action order.

6. Explain how computational thinking improves the energy analysis.

7. Explain why the two-day energy gap cannot establish individual daily use.

8. Explain how abstraction and algorithmic design support a delivery prediction task.

9. Explain how computational thinking helps library database design.

10. Explain how pattern recognition can support network security without proving an attack.

11. Explain the effect of lowering a review threshold.

12. Explain how testing can lead to revised computational thinking.

EXPLAIN IT | A SCHOOL BIKE-LOAN SERVICE

A school lends individually numbered bikes. Each bike may have one active loan at a time; students may borrow one bike at a time. Staff need a confirmation, current availability and a record of completed returns. Explain how each computational thinking concept helps. Include an important assumption, a meaningful test and why your chosen representation retains enough information.

Reveal an explanation outline

Retain StudentID, BikeID and active-loan associations to check both per-bike and per-student restrictions. Separate receiving, checking, recording and reporting. Recognise a shared availability pattern across bikes, while adding the one-bike-per-student rule. Specify checks before saving, then confirm only after a successful save. Test both an already-loaned bike and a student already holding a different bike. Sequential processing is an assumption; simultaneous requests require coordinated operations.

Flashcards

Flashcards

Click to flip. Select the ideas you need to revisit.

0 cards selected for revision.

Selections are kept while this page is open.

Workbook

Workbook

COMING SOON

The workbook for B1.1.3 Applying Computational Thinking is coming soon. Complete the matching task and written questions in your exercise book.