Measuring efficiency and Big O notation – OCR A Level Computer Science lesson (H446)
Students learn to explain why algorithms are compared by how their steps grow with n, and reduce a step-count formula to its Big O.
Lesson 1 of 16 in unit 13.2 Big O and Project Design, taught in Year 13, Autumn 1. It answers one big question: How can we compare two algorithms fairly before we run them?
By the end, students can explain why algorithms are compared by how their steps grow with n, and reduce a step-count formula to its Big O.
- The Build (the main task)
- Explain why Lumenfield Observatory's astronomers should compare two search programs for their star catalogue by counting steps as n grows, not by timing each one on their own laptops (4 marks). Then state the Big O of three step counts from the catalogue programs: 4n + 7, 3n² + 5n + 2 and 250.
- Support version
- Sentence starters for the 4-mark answer ('A stopwatch time depends on…', 'Counting steps as n grows shows…') and a two-row table that splits each formula into its dominant term and the parts to drop.
- Challenge
- Explain why an O(n²) program with a step count of n² can beat an O(n) program with a step count of 1000n when the catalogue holds 500 stars, and find the value of n where they take the same number of steps.
- Real-world link
- Lumenfield Observatory, a fictional observatory, is moving its star catalogue from a few thousand records to millions as a new survey telescope comes online.
- Key words
- Big O notation, Time complexity and Measure, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “A stopwatch time on one computer is a fair way to compare two algorithms”; “Big O gives the exact number of steps, or the time in seconds”.
- OCR H446 specification
- 2.3.1 (a); (c).
Every lesson follows the same Code & Commerce structure: a Bell Task recall starter, key vocabulary with definitions and icons, short teaching chunks with a check before pupils move on, The Build (one main task), challenge questions that get harder, and an exit question. Answers reveal one at a time on the slides, and everything is editable PowerPoint and Word.
Students need computers for the main task.
Also sold in the Big O and Project Design unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.
An independent resource written for OCR A Level Computer Science (H446). It is not endorsed by OCR or Cambridge University Press & Assessment. Programming project (NEA) lessons teach general skills on a made-up example project and give supervised time, within JCQ's rules on the help a centre may give.
What's included
- Slide deck (PowerPoint)
- Lesson plan (Word)
- Worksheet (Word)
- Support worksheet with scaffolds (Word)
- Single-teacher licence: use and adapt it with your own classes
More for A Level Computer Science
See allStudents learn to identify O(1), O(n) and O(n²) code from its loops and explain each answer from how often the statements run.
Students learn to explain logarithmic and exponential growth in terms of halving and doubling, and say why exponential algorithms do not scale.
Students learn to compare algorithms by their best-case and worst-case time and their space, applying the comparison to a given data set.
Written for the specifications named. Not endorsed by or affiliated with any exam board.