1/41
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What is abstraction, in computational thinking?
The process of removing unnecessary details of a problem to focus on the important features needed to implement a solution
Why is abstraction necessary when creating a computational solution to a real-world problem?
The real world is highly complex with far too many variables to model directly; removing irrelevant detail makes a problem manageable and lets a computer process only what actually matters to solving it
What is the difference between an abstraction and reality?
Reality includes every variable and detail of a situation, however small; an abstraction deliberately strips away detail that is irrelevant to the specific problem being solved, keeping only what's needed
*Using the London Underground map as an example, explain why the map is a useful abstraction rather than a geographically accurate map
Travellers only need to know that getting on at stop A will eventually get them to stop B; the actual geographical layout, distances and curves of the tracks are irrelevant to this need, so removing them makes the map clearer and easier to use
*Explain how a road map for a satnav is an abstraction of a real city
Unnecessary detail such as buildings and greenspace is removed, leaving only roads and junctions; junctions can be represented as graph nodes and roads as weighted edges, allowing algorithms like Dijkstra's or A* to be applied to find routes
What four questions should be asked when devising an abstract model for a situation?
What is the specific problem to be solved? Can it be broken into milestones? What elements impact the solution for each milestone? Would removing a given element change the solution?
Give three questions a chair game/sports simulator abstraction model would need to answer
Any three of: Is gravity taken into account? Is air resistance/friction modelled? How closely does the simulation need to resemble reality? What level of detail is required for the intended purpose?
What is programming language abstraction, and what is machine code an example of?
Programming languages abstract away the complexity of controlling hardware directly; machine code (binary) is the lowest level, with no abstraction — every instruction must be written as raw 0s and 1s
How does assembly language abstract away detail compared to machine code, and what is its main limitation?
It uses mnemonics (e.g. ADD) to represent groups of binary digits, making programs quicker and less error-prone to write; its limitation is that each processor family has its own instruction set, so programs must be rewritten to run on a different type of processor
How do high-level languages (e.g. Python) abstract away detail compared to assembly language?
They let a single, short instruction (e.g. A = B*C) represent what would take many lines in assembly, and hide how data is stored in memory or how instructions run on the processor, letting developers focus on solving the problem itself
What is data abstraction, and give an example?
Hiding the underlying implementation details of how a data type is stored and represented, so a programmer can use it without needing to know the details; e.g. a programmer using a queue only needs to know they can add/remove data, not that underneath it is implemented using arrays, bytes, bits and flip-flops
An algorithm's inputs and outputs form part of what wider consideration in computational thinking?
Its preconditions — the conditions that must be true for the algorithm to run and complete successfully
What information should be explicitly defined about an algorithm's inputs and outputs before writing it?
Their type, size, and format (e.g. for a search algorithm: what data type are the elements, how many elements, is the array sorted, and what does the output represent — a value, a boolean, an index, or nothing?)
What is a precondition, in the context of an algorithm?
A condition that must be true before an algorithm is run, in order for it to complete successfully without errors or crashing
Give an example of a precondition for a binary search algorithm, and explain why it matters
The list supplied must already be in order — if an unordered list is passed to a binary search, it will fail to execute correctly, since the algorithm's logic relies on being able to eliminate half the remaining list at each step based on order
What are the benefits of explicitly specifying an algorithm's preconditions in its documentation?
The developer calling the subroutine knows in advance what checks they need to carry out before calling it; it avoids the subroutine itself needing to carry out extra validation code; and it allows the subroutine to be reused reliably, including being placed in a shared library
What is caching, in computational thinking?
Storing frequently used data and instructions in a small area of fast storage (cache) close to the processor, so that program execution can access them more quickly than repeatedly fetching from slower memory
Give one benefit of caching outside of CPU cache, such as web caching
Storing recently viewed HTML pages/images locally means they don't need to be re-downloaded each time they're accessed, giving faster access and saving bandwidth
Why are reusable program components (e.g. subroutines in a library) useful?
Common tasks (e.g. printing, casting, finding a maximum value, generating random numbers) can be written once, thoroughly tested, and documented, then reused across multiple projects — saving development time and reducing the risk of bugs compared to rewriting the same logic repeatedly
What does it mean to "identify the components of a problem"?
Abstracting away unimportant detail from the real-world problem and identifying the specific elements that will actually form part of the solution
*A teacher wants software to calculate grades for several classes over a year — give two questions that would help identify the components of this problem
Any two of: How many classes/students are there? What are the possible grades a student could achieve? How many assessments need to be considered? Are assessments split into difficulty categories?
What does it mean to "identify the components of a solution"?
Once the components of the problem are known, working out the matching technical elements needed to build a solution — e.g. what data types, data structures, libraries, and program constructs will be required
What is decomposition, and what is one common method used to carry it out?
Breaking a problem down into smaller, more understandable, and more easily solved sub-problems; a common method is top-down design
What is top-down design?
A method of decomposition where a problem is broken into major tasks, and those major tasks are broken into smaller sub-tasks, repeating until each sub-task can be solved with a single subroutine or module that cannot sensibly be broken down further
Give two advantages of decomposing a problem into sub-problems (subroutines)
Any two of: each subroutine is simpler to test and maintain (e.g. via unit testing), self-contained and well-documented code is easier to debug, tasks can be delegated to different developers, and subroutines can be reused rather than rewritten
What is a hierarchy chart, and what is it used for?
A diagram (in the form of a tree structure) used to show how a problem has been decomposed into subproblems, and how the resulting modules/subroutines relate to each other
Why are diagrams like hierarchy charts often preferred over lists or tables for decomposing larger problems?
Lists and tables quickly become cumbersome and hard to follow as a problem grows in complexity, whereas a diagram like a hierarchy chart makes the relationships between sub-problems clear and easy to follow at a glance
Name the three structured programming techniques used to control the flow of a program
Sequence (one statement after another), selection (decision making, e.g. if/then/else or switch/case), iteration (loops, e.g. for/while/do)
Why is it good practice for each block of code in structured programming to have a single entry and exit point?
It prevents unintended consequences relating to flow of control, such as leaving a subroutine early, entering it unexpectedly, or branching unintentionally, which makes programs harder to understand and debug
Why might a flowchart or pseudocode be used before writing code in a specific programming language?
It allows the algorithm/decision points to be planned and checked independently of a specific language's syntax; flowcharts show flow of control visually (though are time-consuming to create), while pseudocode mimics program constructs without needing correct syntax
Where in a program do decision points ("where a decision has to be taken") typically occur?
In selection structures (e.g. if statements, switch/case) and in iteration structures (e.g. while loops), wherever a Boolean condition determines what happens next
Why is care especially needed when constructing Boolean conditions with multiple clauses (e.g. combining AND/OR/NOT)?
Most programming errors occur when evaluating Boolean conditions, and long/complex conditions involving multiple clauses are especially error-prone if not carefully constructed and tested
How do decisions affect the flow of control through a program?
Each decision point (in an if/else, switch/case, or loop condition) directs the program down a different path of statements depending on whether the Boolean condition evaluates to true or false, meaning different code executes for different inputs
*In a program checking "if age >= 15 AND money >= 8 then entry = True", what are the logical conditions affecting the outcome?
Two conditions must both be true simultaneously (an AND condition): the age must be at least 15, and the money must be at least 8; if either condition is false, entry remains false
What is the difference between concurrent computing and parallel computing?
Concurrent computing runs multiple processes/tasks on a single processor by giving each a fraction of time before swapping to another; parallel computing runs multiple processes genuinely at the same time across multiple processor cores
*Why does concurrent processing on a single core appear simultaneous to a human user, even though it isn't?
Because the processor swaps between tasks extremely quickly (microsecond timeslices), and human information-processing speed is far too slow to notice the switching, so the effect looks simultaneous even though execution is actually sequential
What is a dependency, in the context of deciding whether tasks can be tackled at the same time?
A relationship where one task relies on another task starting or completing before it can begin, meaning dependent tasks cannot be run in parallel (e.g. a roof cannot be built until the walls are finished)
When can parts of a problem be run in parallel across multiple cores?
When the datasets or tasks involved do not rely on, relate to, or interact with each other (i.e. have no dependencies), allowing them to be processed independently and simultaneously
Give one advantage and one disadvantage of concurrent processing
Advantage: increases program throughput, since more tasks make progress within a given timeframe (e.g. ten tasks half-finished rather than two fully finished). Disadvantage: if many processes require heavy computation, each is allocated only a timeslice, so all of them take longer to fully complete
Give one advantage and one disadvantage of parallel processing
Advantage: significantly speeds up repetitive calculations on large datasets (e.g. image/video editing) by splitting the work across multiple processors. Disadvantage: processors running simultaneously may need to communicate with each other, introducing overhead and delays
*Why might a video game use concurrent processing for background tasks like loading assets while the main game loop keeps running?
It allows the game to keep responding to user input and rendering frames smoothly, while other tasks (like loading the next level's assets) are given smaller timeslices in the background, avoiding the whole game freezing while it waits for a slower task to complete
*Why might a video editing application use parallel processing rather than concurrent processing when rendering a final video?
Rendering large amounts of repetitive frame-by-frame calculation benefits from being split genuinely simultaneously across multiple processor cores, since the frames don't depend on each other and true parallelism gives real speed gains, unlike concurrency which only gives the appearance of simultaneity on a single core