GRADE 9 · COMPUTING · UNIT 1 · LESSON 1.6
Computational thinking and programming
Comparing algorithms
Read a little. Try the workbook. Check your answers. Choose one section below to get started.
LET’S LOOK, THINK AND TRY
Comparing algorithms
- Compare two algorithms against the same functional requirements
- Identify correctness and boundary shortcomings
Check correctness before efficiency
Compare algorithms against the same explicit requirements and inputs. Check normal cases, repeated values and negative values where they are allowed. A short program or a low operation count is not a good solution if it gives the wrong result or changes data that should be preserved.
Name exactly what you count
Distinguish measured running time, memory requirements, clarity and a stated operation count. Counting only comparisons of list values is a useful paper model, but it omits indexing, assignments and loop control. It is not a stopwatch measurement. Explain the scope of the evidence rather than claiming that one method is always fastest.

Work through an original example
Find the maximum in the original list [-7, -3, -11, -3] by starting with its first value and comparing each remaining value once.
Set largest to -7. Comparing -3 updates largest to -3. Comparing -11 leaves it unchanged. Comparing the final -3 also leaves it unchanged because it is not greater. The maximum is -3, after three value comparisons. The input list stays unchanged. Starting largest at 0 would give the wrong answer for this all-negative list.
Try it before the workbook
Using the same method on [-8, -15, -1], what maximum is found?
Use the example to choose your first step. This short preparation question is separate from your workbook. Open the check clue when you are ready.
Explore the clues
Open one card at a time to review your thinking.
Remember the idea
Compare algorithms against the same explicit requirements and inputs. Check normal cases, repeated values and negative values where they are allowed. A short program or a low operation count is not a good solution if it gives the wrong result or changes data that should be preserved.
Check your first try
-1
Start with -8, keep it after comparing -15, then replace it with -1. There are two value comparisons.
Explain and check
- Match exact code outputs, binary widths and stated units. Explain your method.
- Check the question, rules, outputs and units. Explain why your method works.

Think it through with Paxa!
Trace the stated rules and distinguish predictions from actual observations.
Original computing practice files
Optional small offline examples and fictional datasets, created for PaxaKids. They are supplementary practice, not publisher downloads or complete implementations of every workbook project. The page does not execute these files. Inspect code with a grown-up before using it in an approved offline environment; do not use real personal data.
Our Unit 1 learning path
- Lesson 1.1: Pseudocode
- Lesson 1.2: Iteration
- Lesson 1.3: Creating algorithms
- Lesson 1.4: Loops in text-based programming
- Lesson 1.5: Programming with data
- Lesson 1.6: Comparing algorithms
- Lesson 1.7: Searching algorithms
- Lesson 1.8: Testing
- Lesson 1.9: Physical computing
- Lesson 1.10: Word guess
- Lesson 1.11: Flowchart - Pseudocode - Program code
- Lesson 1.12: Original Paxa project: Revision challenge app
- Lesson 1.13: Check your progress
- Lesson 1.14: Computational thinking and programming - unit check
For grown-ups: using this lesson
Discuss the idea and worked example, then try the workbook. Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses. Accept a sound alternative method.
Opening or checking a worksheet does not complete a lesson. Choose “Mark lesson finished” when ready. Optional account progress saves the selected grade, lesson position and completion across devices. Personal worksheet responses stay in this tab; save your own copy before leaving.
2. Fill in your workbook
Use the original diagrams and stated conventions. Choose, write or draw on the pages, or use the larger Answer List controls. Code examples here are for tracing; this page does not execute them or connect to hardware. Use fictional data and approved supervised tools for project work.
Opening your PDF…
Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.
You’ve completed the checked activities.
TAKE YOUR PRACTICE OFFLINE
3. Download the student worksheet
All 14 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.
Student worksheet only · PDF · 6.8 MiB · No answer key included
TRY FIRST, THEN CHECK TOGETHER
Download the student worksheet →4. Answers & guidance
Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.
Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.
Show answers for all 14 worksheets
Worksheet 1
- Question 1: What should be checked before comparing efficiency? Whether both solutions meet the required task
Worksheet 2
- Question 2: Which input meets the stated precondition? Six integers including negative values
- Question 3: What result is required when the maximum repeats? The maximum value once
Worksheet 3
- Question 4: What maximum value is printed first? 12
- Question 5: How many value comparisons are printed next? 5
Worksheet 4
- Question 6: After index 1: largest 7
- Question 7: After index 2: largest 12
- Question 8: After index 3: largest 12
- Question 9: After index 5: largest 12
- Question 10: Why are there five value comparisons for six elements? The first element is used for initialisation
Worksheet 5
- Question 11: What maximum value is printed first? 12
- Question 12: How many value comparisons are printed next? 30
Worksheet 6
- Question 13: How many additional comparisons does B make? 25
- Question 14: How many times as many comparisons does B make? 6
Worksheet 7
- Question 15: Which is a fair correctness comparison? Run both on the same inputs with the same expected maxima
Worksheet 8
- Question 16: Case N: expected maximum -3
- Question 17: Case R: expected maximum 4
- Question 18: Case L: expected maximum 9
- Question 19: Which case is most likely to expose largest = 0? Case N
Worksheet 9
- Question 20: Extra reference slots for a copy of 6 items 6
- Question 21: Extra reference slots for a copy of 12 items 12
- Question 22: What would support a claim about actual peak memory bytes? An appropriate measurement with the environment and scope stated
Worksheet 10
- Question 23: Which is a useful clarity observation? A names the current maximum clearly and uses one scan
- Question 24: What must a comparison report disclose? Its input assumptions and what was measured or counted
Worksheet 11
- Question 25: What incorrect value is displayed? 0
- Question 26: What is the required maximum for this input? -3
- Question 27: Which initialisation handles all-negative non-empty input? largest = numbers[0]
Worksheet 12
- Question 28: Which conclusion is supported by these records? A used fewer counted comparisons on the tested cases
- Question 29: What further evidence would a runtime claim need? Controlled timing measurements with repeated runs
Worksheet 13
- Question 30: Create a compact comparison rubric covering correctness, robustness, work, storage and clarity. Recommend a solution with reasons. Include expected maxima and counts for the negative and repeated tests, and state a limitation of your evidence. Correctness: both give -3 for N and 4 for R, preserving the six-item input; author execution supplies observed evidence. Robustness: precondition is six already supplied integers; neither snippet validates user text or arbitrary list size. Work: A makes5 value comparisons; B makes30 for either six-item case, using the stated definition. Storage: both use the shared input without another list and bounded extra scalars; do not claim exact byte usage. Clarity: A uses one understandable traversal while B repeats an unnecessary scan. Recommend A for these requirements and this comparison evidence. Counts do not establish elapsed-time ratios, sampled tests do not prove every input correct, and actual memory is unmeasured. Accept justified alternatives only when consistent with all required correctness and evidence. A student practical claim needs observed records, otherwise Pending. Grown-up review; discuss your evidence and reasoning.
Worksheet 14
- Question 31: Explain and correct the negative-input fault, then give an expected retest result. For an adapted 12-item list, calculate each comparison count. Explain why those counts and the number of variable names cannot prove actual runtime or memory bytes. Record a run or Pending. Starting largest at0 incorrectly returns0 for N although all allowed inputs are negative; initialise from the first actual element, guarding an empty list if that new case is allowed. Correct N maximum is-3. Equal repeated data R must yield4. At n12, A uses11 comparisons and B uses12*11=132; these are defined value comparisons, not all operations or timings. Number of variable names does not establish object sizes, allocation, sharing or peak bytes. Both shown algorithms use no additional list and bounded scalar state under the model. Controlled repeated timing and scoped memory measurements would be needed for stronger empirical claims. The extension changes the six-item precondition and must be labelled. Actual test records identify input, expected and observed outcome; otherwise Pending with a trace. Grown-up review; discuss your evidence and reasoning.
Curriculum & workbook reference
- Cambridge Lower Secondary Computing Learner’s Book 9 — pages 119–122
Computing for your homeschool day
Explore Comparing algorithms with this free Grade 9 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.
Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.
Understand your results
Closed answers are checked in your browser. Drawings and written explanations need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.
Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.
For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.
The original practice follows the source topic teaching.
The page references identify the reviewed actual supplied book teaching and related practice. Only the cited Learner’s Book teaching pages are listed here. No matching publisher Workbook 9 was supplied or cited. The original PaxaKids workbook is the student download; no textbook scan is published. Explanations, worked models and student workbooks here are original PaxaKids companion material.
The source topic number is preserved.
