Loading...
An algorithm is a finite, clear sequence of steps for solving a class of problems. Decomposition divides a complex problem into manageable parts. Abstraction keeps relevant detail while omitting what is unnecessary for the task. A route map, for example, may preserve connections without precise physical scale. Define inputs, outputs and constraints before writing code so success can be judged.
Video by Craig'n'Dave. The video’s own board label is retained; follow the specification reference and scope notes on this lesson for assessed content.
Viewing focus: Decompose a problem and select relevant detail
After watching, attempt these questions before opening the answers. You can also use the written lesson below.
After watching 1: What does decomposition do?
Splits a problem into smaller parts. Parts can be designed and tested separately.
After watching 2: What should a trace table follow?
Actual execution order. Updates affect subsequent statements.
What you'll be able to do
An algorithm is a finite, clear sequence of steps for solving a class of problems. Decomposition divides a complex problem into manageable parts. Abstraction keeps relevant detail while omitting what is unnecessary for the task. A route map, for example, may preserve connections without precise physical scale. Define inputs, outputs and constraints before writing code so success can be judged.
A trace table records values as statements execute. Initialise variables first, then update them in the actual order. An assignment uses the current value on its right-hand side; a later statement sees any update already made. For loops, track the control variable, condition and number of iterations. Record output separately from stored values. Careful tracing often reveals an off-by-one boundary error or an accumulator that was reset in the wrong place.
Pseudocode should be unambiguous even if a particular syntax differs from Python. Flowcharts use decisions with labelled branches and process steps connected in execution order. A correct algorithm must terminate appropriately and handle the allowed inputs, including boundary cases. Evaluate efficiency using the number of operations or data accesses under stated assumptions, rather than judging only the number of lines in a drawing.
Attempt these problems on paper before opening the worked reasoning. Explain your steps as well as giving a final answer.
Common mistakes to avoid
Key takeaways
Question 1: What details can a bus-route planner abstract away?
Retain what affects route choice, not every real-world detail.
Check the assessed scope and practical or mathematical requirements.
An external explanation or interactive activity to use alongside the lesson. It may include extension material.
Close the notes and answer from memory. Revisit any explanation you cannot yet reconstruct.
Test yourself
Answer a few questions, then review anything you missed.
Start with the quiz above to check the key ideas. You can also choose another topic from the practice library.