This mini-lesson covers OCR 2.1 โ Elements of computational thinking: the five habits of mind that OCR examines directly, and that underpin the whole of Component 02.
Work through each screen, answer the questions as you go (some are recall, some are calculations you must actually work out) and collect โญ stars. Press Start when you're ready.
Abstraction is the deliberate removal of detail that does not matter, so that what does matter can be reasoned about.
Every abstraction is a choice about what to lose. The skill lies in knowing which details are safe to discard: a flight simulator that abstracts away turbulence is a fine game and a dangerous training tool.
Reality vs an abstraction of reality: a model is never the thing itself. A road-network graph with weights for distance cannot answer questions about roadworks unless you built that in. When a model gives a stupid answer, the fault is usually in what the abstraction omitted.
Deciding in advance what a program will need and what it must guarantee.
The cost of caching is not zero: cached data can become stale โ the cached page is no longer what the server holds โ and the cache consumes memory. You trade space for time, and you accept the risk of serving something out of date. Naming that trade-off is what earns the marks.
Decomposition breaks a problem into sub-problems, and those into sub-problems, until each piece is small enough to solve directly. This is top-down design, and it is what a structure chart shows.
Why it works:
Thinking logically means identifying every decision point โ every place the flow of a program can branch โ and being certain what happens in each case, including the ones you did not expect. Every unhandled branch is a bug waiting to happen.
The order of the sub-problems matters. Decomposition is not just chopping the problem up; it is working out which pieces depend on which. You cannot sort before you have read the data, and you cannot validate before you know the rules.
Concurrent processing interleaves tasks so they appear simultaneous โ on a single core, the OS rapidly switches between them. Parallel processing runs them genuinely at the same time on multiple cores.
| Benefit | Cost |
|---|---|
| More work completed in the same time | Not every task can be parallelised โ some steps depend on earlier ones |
| The program stays responsive while waiting for I/O | Shared data must be protected: race conditions and deadlock |
| Independent work can be split across cores or machines | Coordination overhead, and much harder debugging โ bugs may not be reproducible |
A task takes 100 s. 80% of it can be parallelised; the other 20% cannot.
Sequential part: 20 s. Parallel part on 4 cores: 80 รท 4 = 20 s.
Total = 20 + 20 = 40 s โ a speed-up of 2.5ร, not 4ร.
With infinite cores the parallel part shrinks to nothing, but the 20 s sequential part remains. You can never beat 20 s.
That is Amdahl's law, and it is the single most important thing to say about parallelism in an exam. The speed-up is capped by the part of the task that cannot be divided, no matter how many cores you throw at it.
binarySearch(list, target) states the precondition the list is sorted in ascending order. What is the point of stating it?Thinking logically means finding every point at which the program can branch, and being certain what happens on every path โ including the ones you did not plan for.
The missing ELSE is a classic: the code above leaves grade undefined for any score of 30 or below. Every chain of conditions needs a final ELSE that catches everything else โ even if all it does is raise an error.
Reusable components are written once and used many times โ a library, a class, a subroutine with well-chosen parameters. The gains are compounding: less code to write, one place to fix a bug, and behaviour you have already tested. The discipline it demands is generality: a routine hard-coded to one file name is not reusable.
Performance modelling simulates how a system will behave before it is built โ the load on a server at peak, the length of a supermarket queue, the throughput of a network. It is used where testing the real thing would be too expensive, too slow, or too dangerous (you cannot crash a real aircraft to see what happens).
The limit of any model: it inherits every assumption of the abstraction beneath it. A queue model that assumes customers arrive at random will be badly wrong at 5 p.m. on a Friday. When a model gives an absurd answer, suspect the assumptions, not the arithmetic.
Tap the activity, then tap the kind of thinking it shows.
Tap an item on the left, then its partner on the right.
Thinking abstractly: representational ยท generalisation ยท procedural ยท data โ every abstraction is a choice about what to lose
Thinking ahead: inputs and outputs ยท preconditions ยท caching (space for time, risk of staleness) ยท reusable components
Thinking procedurally: decomposition ยท top-down design ยท order of dependency between sub-problems
Thinking logically: identify every decision point and know what happens in every branch
Thinking concurrently: concurrent (interleaved) vs parallel (simultaneous) ยท race conditions and deadlock ยท Amdahl's law caps the speed-up
That is the whole of OCR 2.1. Press Finish to see your score.
You've worked through Elements of computational thinking for OCR A-level Computer Science (H446). ๐
Your stars: 0 / 0
Next: test yourself in the Evaluate stage Confidence Quiz, then lock it in with Verify.