A good algorithm turns a design problem into steps a computer can repeat, and testing and refining it shows how close a solution is to the best and why.
How can a step-by-step search help us find, test and justify the best design?
We are learning to
- We are learning to turn a spatial problem into an algorithm with clear steps and decisions.
- We are learning to use digital tools to test an algorithm and refine it.
- We are learning to compare solutions using different criteria.
- We are learning to communicate and justify a solution, including its limits.
Success criteria: I can…
- I can describe a search algorithm in numbered steps, including the decision that keeps the best result.
- I can build a spreadsheet that tests many possible designs at once.
- I can refine a search by using a smaller step around the best result and explain what changes.
- I can explain why different criteria (total distance or farthest distance) can give different best answers.
- I can justify a solution with evidence from my tests and state at least one limitation.
Key competencies
- Numeracy
- Calculate areas, distances with the distance formula and coverage percentages to compare designs.
- Digital Literacy
- Build spreadsheets that run search algorithms and a coverage checker, and debug formulas that give wrong results.
- Critical and Creative Thinking
- Design, test and refine placement rules and judge which criterion suits a real situation.
Week by week
9 lessons · 4 assessment points
| Week | Focus | Key question | Main evidence |
|---|---|---|---|
| 1 | Search algorithms for the biggest garden | How can a step-by-step search find the best rectangle, and how do we know it is the best? | Written search algorithm, the fencing spreadsheet and the wall-version flowchart. |
| 2 | Grid search for the best location | Where should a shared facility go, and does the answer depend on what we are trying to make small? | Total distance calculations, the grid search spreadsheet with refinements, and two justified recommendations. |
| 3 | Design, test and refine a sprinkler layout | How few sprinklers can water the whole lawn, and how can we be confident in our answer? | Coverage checker results for Designs A and B, the grid rule spreadsheet, the peer test, the summative test and the project report. |
- 1
Week 1: Search algorithms for the biggest garden
How can a step-by-step search find the best rectangle, and how do we know it is the best?
- DiagnosticLesson 1: the 5-question diagnostic (distance formula, area and perimeter, reading a spreadsheet formula, describing an algorithm), in resources.
Lesson 1The biggest garden
Meet an optimisation problem and solve it by trial before designing an algorithm.
- Diagnostic (resources), 10 minutes.
- Opener puzzle: "You have 40 m of fencing for a rectangular vegetable garden. What size gives the most area?" Pairs try rectangles on grid paper (for example 15 × 5 = 75 m², 12 × 8 = 96 m², 10 × 10 = 100 m²).
- Class table of widths and areas on the board. Ask: "How do we know we haven't missed a better one?" (we need to try every possibility in an organised way)
- Pairs write the search algorithm in steps: 1. Set width w = 1. 2. Length = 20 − w. 3. Area = w × (20 − w). 4. If the area is the biggest so far, record w and the area. 5. Add 1 to w. 6. If w < 20, go to step 2; otherwise stop and report the best.
Lesson 2Let the spreadsheet search
Implement the fencing search in a spreadsheet, then refine the step size.
- Opener quick quiz: "What does =A2*(20-A2) give when A2 is 7?" (7 × 13 = 91)
- Pairs build the fencing search (Spreadsheet steps in resources): widths 1 to 19 in column A, length in B, area in C, and =MAX(C2:C20) to find the best area (100 m² at w = 10).
- Refine: change the step to 0.5, then 0.1, around w = 10. Ask: "Did the best answer change?" (no: 9.5 × 10.5 = 99.75 and 10 × 10 = 100, so the square stays best)
- Ask: "What would a step of 3 have missed?" (widths 1, 4, 7, 10 still include 10, but widths 2, 5, 8, 11 would miss it and give 99 at w = 11: a coarse search can miss the best)
Lesson 3Change the problem: a wall
Adapt the algorithm when one side of the garden is a wall, and describe how the algorithm works.
- Opener image: sketch the garden against the school building, so only three sides need fencing.
- Pairs predict the best shape, then change the length formula to 40 − 2w and rerun the search. Result: w = 10 m, length 20 m, area 200 m² (check neighbours: 9 × 22 = 198 and 11 × 18 = 198).
- Ask: "Why isn't the best shape a square any more?" (the wall side needs no fencing, so it pays to make that side longer)
- Pairs draw a flowchart of their search algorithm and write two sentences explaining how it guarantees the best whole-number width.
Curriculum links
- AC9M10SP03: designing, testing and refining an algorithm for a spatial problem using a spreadsheet
Formative checkpoint
Can each pair explain how their search keeps the best result and what a smaller step changes?
Support
- Give the spreadsheet with column A already filled so students write only the length and area formulas.
- Use a table on paper for widths 1 to 19 before moving to the spreadsheet.
Extension
- Ask: "With 40 m of fencing and walls on two sides that meet at a corner, what is the best rectangle?" (only two sides need fencing: w + l = 40, best 20 m by 20 m, 400 m²)
- Ask students to change their algorithm so it stops as soon as the area starts to fall, and explain when that shortcut is safe.
Main evidence
Written search algorithm, the fencing spreadsheet and the wall-version flowchart.
Key vocabularyoptimisealgorithmsearchstep sizerefinemaximum - 2
Week 2: Grid search for the best location
Where should a shared facility go, and does the answer depend on what we are trying to make small?
- FormativeLesson 6: the 4-question checkpoint on the fencing and water station searches (in resources), self-marked against the worked answers.
Lesson 4Where should the water station go?
Set up a location problem on a coordinate grid and calculate total distances by hand.
- Opener story: four sports fields (A to D, coordinates in resources) will share one water refill station. Ask: "Where would you put it? Put a sticky dot on the map."
- Pairs calculate the total walking distance (straight line) from two points: their own guess and the centre of the map (50, 40), using the distance formula. At (50, 40): 64.0 + 50.0 + 36.1 + 64.0 = 214.1 m.
- Compare guesses as a class. Ask: "How could we test many more points without hours of calculating?" (put the distance formula in a spreadsheet and search a grid)
- Pairs write the grid search algorithm in steps, matching the structure of the fencing search.
Lesson 5Grid search and refine
Run a grid search in a spreadsheet, refine it and explain the result.
- Opener: show the 20 m grid of total distances (resources). Ask: "Which point is best?" ((40, 40), 213.5 m)
- Pairs build the grid search (resources) and refine it: a 5 m grid around (40, 40) gives (45, 35) at 212.9 m; a 1 m grid gives (44, 36) at 212.9 m.
- Ask: "Look at where the best point is on the map. What do you notice?" (it is on line AD and line BC: where the two diagonals cross, at about (44.4, 35.6))
- Justify: any other point P is further in total, because PA + PD is at least AD and PB + PC is at least BC (the shortest path between two points is the straight line), so the smallest total is AD + BC = 128.1 + 84.9 = 212.9 m, reached only where the diagonals cross.
Lesson 6A different criterion
Compare the best point for total distance with the best point for the farthest walk.
- Opener question: "If this were a first-aid kit, would you care about the total walk or the longest walk?" (the longest: whoever is farthest needs it fastest)
- Pairs change the spreadsheet from SUM to MAX of the four distances and search again: best point (50, 40), where the farthest field is 64.0 m away, compared with 71.1 m at the diagonal crossing.
- Formative checkpoint (resources), self-marked.
- Pairs write a recommendation for each item (water station and first-aid kit), each justified with numbers from their searches.
Curriculum links
- AC9M10SP03: testing and refining a grid search with digital tools and justifying the solution
- Mathematics: the distance between two points on the Cartesian plane
Formative checkpoint
Can each pair explain why the best point for total distance differs from the best point for the farthest walk?
Support
- Provide the distance formula for one field already typed in so students copy and change the coordinates.
- Plot the four fields and the best point on grid paper.
Extension
- Ask: "Add a fifth field at E(100, 0). Does the best total-distance point move? Use your spreadsheet."
- Ask students to explain, using the shortest path between two points, why no point can beat the diagonal crossing for four fields at the corners of a convex quadrilateral.
Main evidence
Total distance calculations, the grid search spreadsheet with refinements, and two justified recommendations.
Key vocabularycriteriongrid searchtotal distancefarthest distancediagonaljustify - 3
Week 3: Design, test and refine a sprinkler layout
How few sprinklers can water the whole lawn, and how can we be confident in our answer?
- FormativeLesson 8: peer test of each pair's placement rule on the 30 m by 16 m lawn, checked against the coverage checker.
- SummativeLesson 9: the 6-question summative test (in resources, 24 marks) and the sprinkler project report, marked with the project marking guide (in resources).
Lesson 7Sprinkler test bench
Test sprinkler layouts for a 20 m by 12 m lawn with a spreadsheet coverage checker.
- Opener demonstration: draw the 20 m by 12 m lawn and two 5 m reach circles to scale on the board. Ask: "How many sprinklers will we need? Where?"
- Pairs build the coverage checker (resources): 273 test points 1 m apart, the distance to each sprinkler, the nearest distance and whether it is within 5 m.
- Test Design B (4 sprinklers at (5, 3), (15, 3), (5, 9), (15, 9)): 240 of 273 points covered, 87.9%; the 33 missed points lie on the lines x = 0, x = 10 and x = 20 (all except y = 3 and y = 9), and the worst, such as the corners and the centre (10, 6), are 5.83 m from the nearest sprinkler.
- Test Design A (6 sprinklers at x = 3.33, 10, 16.67 and y = 3, 9): all 273 points covered; the farthest any point is from a sprinkler is about 4.48 m.
Lesson 8Design a placement rule
Design a general algorithm for any rectangular lawn, then test and refine it.
- Opener question: "Why did Design A work? What do its six sprinklers have in common?" (each sits in the centre of an equal rectangle whose corners are within 5 m)
- Model the grid rule (resources): split the lawn into c columns and n rows of equal cells; it works if the half-diagonal of a cell is at most the reach; search for the c and n with the smallest c × n.
- Pairs build the rule in a spreadsheet and test it on a new lawn, 30 m by 16 m with a 6 m reach (best grid: 4 columns by 2 rows, 8 sprinklers; half-diagonal √(3.75² + 4²) ≈ 5.48 m). Formative: a peer checks it with the coverage checker.
- Refine: pairs try to beat the grid rule on either lawn with a staggered layout, and test it. (Our own search found no 5-sprinkler layout that covers every test point on the 20 m by 12 m lawn; a pair that finds one must show all 273 points covered.)
Lesson 9Test and report
Show the unit's learning in a test and a justified project report.
- Opener: pairs swap their draft recommendations to the groundskeeper and check one number in the other pair's report.
- Summative test (resources), 35 minutes, calculators and spreadsheets allowed.
- Pairs finish the project report (brief in resources): the algorithm, the test results, the refinement, the recommended layout and one limitation (for example, real sprinklers spray unevenly and wind changes their reach).
- Reflection: "Which of the three problems was hardest to turn into an algorithm, and why?"
Curriculum links
- AC9M10SP03: designing and refining a placement algorithm, testing it with a spreadsheet and communicating a justified solution
Formative checkpoint
Does each pair's placement rule give a layout that the coverage checker confirms covers 100% of the test points?
Support
- Give the coverage checker already built so students only enter sprinkler coordinates.
- Use compasses on a 1 cm = 1 m scale drawing to see the gaps before testing in the spreadsheet.
Extension
- Ask: "Change the test points to every 0.5 m. Does Design A still cover every point? Why is a finer grid of test points more convincing?"
- Ask students to find, with the grid rule, the reach needed for 4 sprinklers to cover the 20 m by 12 m lawn. (2 by 2 cells need √(5² + 3²) ≈ 5.83 m)
Main evidence
Coverage checker results for Designs A and B, the grid rule spreadsheet, the peer test, the summative test and the project report.
Key vocabularycoveragereachtest pointhalf-diagonalstaggered layoutlimitation
Cross-curricular links
- Digital Technologies: designing and tracing algorithms with sequence, decisions and repetition, implemented in a spreadsheet.
- Design and Technologies: designing a watering layout to a specification and evaluating it.
Resources
- Diagnostic (Lesson 1) with answers: 1. Find the distance between (2, 3) and (8, 11). (10: √(6² + 8²) = √100) 2. Find the area of a rectangle 7 m by 13 m. (91 m²) 3. Find its perimeter. (40 m: 2 × (7 + 13)) 4. In a spreadsheet, A2 contains 6. What does =A2*(20-A2) give? (6 × 14 = 84) 5. Describe in steps how to find the largest number in a list. (start with the first number as the biggest; compare each next number; if it is bigger, it becomes the biggest; at the end, report the biggest)
- Spreadsheet steps, fencing search (Google Sheets or Excel): A1 width, B1 length, C1 area. A2 1, A3 =A2+1, fill down to A20 (widths 1 to 19). B2 =20-A2 (four sides of fencing), C2 =A2*B2, fill both down. Best area: =MAX(C2:C20) (100 at width 10). Wall version: B2 =40-2*A2 (best area 200 at width 10). Refine: change A3 to =A2+0.1 and A2 to a value just below the best, such as 9.
- Field coordinates (invented, metres from the south-west corner of the sports ground): A(0, 0), B(80, 0), C(20, 60), D(100, 80).
- Spreadsheet steps, water station grid search: in a grid, put x-values 0, 20, 40, 60, 80, 100 across row 1 (B1:G1) and y-values 0, 20, 40, 60, 80 down column A (A2:A6). In B2 type =SQRT((B$1-0)^2+($A2-0)^2)+SQRT((B$1-80)^2+($A2-0)^2)+SQRT((B$1-20)^2+($A2-60)^2)+SQRT((B$1-100)^2+($A2-80)^2) and fill across and down. Use MIN to find the smallest total. To refine, change the x and y headings to 5 m or 1 m steps around the best point. For the farthest-walk criterion, replace each + between the SQRT terms with commas inside MAX( ).
- 20 m grid of total distances (m), rows y = 80, 60, 40, 20, 0 and columns x = 0, 20, 40, 60, 80, 100: y = 80: 321.4, 282.5, 267.2, 267.2, 276.4, 293.0. y = 60: 282.0, 230.6, 227.5, 232.8, 248.3, 279.9. y = 40: 265.4, 226.3, 213.5, 218.1, 237.4, 274.9. y = 20: 263.8, 231.5, 219.0, 220.2, 237.8, 279.7. y = 0: 271.3, 253.1, 243.2, 241.6, 247.3, 300.0.
- Worked results, water station: best total distance at the crossing of diagonals AD and BC, about (44.4, 35.6), total = AD + BC = √(100² + 80²) + √(60² + 60²) = 128.1 + 84.9 = 212.9 m; distances from there to A, B, C, D about 56.9, 50.3, 34.6 and 71.1 m. Best farthest walk at (50, 40): distances 64.0, 50.0, 36.1 and 64.0 m, so the farthest walk is 64.0 m (total 214.1 m).
- Spreadsheet steps, sprinkler coverage checker: A1 x, B1 y. A2 =INT((ROW()-2)/13), B2 =MOD(ROW()-2,13), fill down to row 274 (273 test points from (0, 0) to (20, 12), 1 m apart). Sprinkler table: K1 x, L1 y, sprinkler coordinates in K2:L7. Distances: C2 =SQRT(($A2-$K$2)^2+($B2-$L$2)^2), D2 the same with $K$3 and $L$3, and so on to H2 with $K$7 and $L$7; fill down. I2 =MIN(C2:H2) (nearest sprinkler), J2 =IF(I2<=5,1,0), fill down. Coverage: =SUM(J2:J274)/273. For a design with fewer than 6 sprinklers, put the unused sprinklers at (1000, 1000), because a blank cell counts as 0 and would place a sprinkler at (0, 0).
- Grid rule for sprinklers: for a lawn L m by W m and reach r m, try c columns and n rows. Each cell is L/c by W/n, and a sprinkler at its centre covers it if √((L/(2c))² + (W/(2n))²) ≤ r. Choose the c and n that work with the smallest c × n. 20 by 12, r = 5: 3 by 2 works (√(3.33² + 3²) ≈ 4.48), but 2 by 2 (√(5² + 3²) ≈ 5.83) and 2 by 3 (√(5² + 2²) ≈ 5.39) do not, and one row never works because 12/2 = 6 > 5. 30 by 16, r = 6: one row never works (8 > 6); with 2 rows, 4 columns work (√(3.75² + 4²) ≈ 5.48) but 3 do not (√(5² + 4²) ≈ 6.40), so 8 sprinklers; 3 rows need 3 columns (9 sprinklers).
- Checkpoint (Lesson 6) with answers: 1. With 32 m of fencing for four sides, what rectangle has the largest area? (8 m by 8 m, 64 m²) 2. With 32 m of fencing and a wall as the fourth side? (width 8 m, length 32 − 16 = 16 m, area 128 m²) 3. Find the total distance from (40, 40) to the four fields. (√3200 + √3200 + √800 + √5200 = 56.6 + 56.6 + 28.3 + 72.1, which is 213.5 m to 1 decimal place; adding the rounded distances gives 213.6 m) 4. A search with a 20 m grid chose (40, 40). Why isn't this the true best point? (the grid only tests points 20 m apart, so the best point (44.4, 35.6) lies between grid points; refining with a smaller step finds a lower total)
- Summative test (Lesson 9, 24 marks) with answers: 1. A rectangular pen against a fence uses 60 m of fencing for three sides. Write an area formula for width w, describe a search algorithm and find the best dimensions. (4 marks: A = w(60 − 2w); try w = 1, 2, 3, … and keep the largest; w = 15 m, length 30 m, area 450 m²) 2. Four sites are at P(0, 0), Q(60, 0), R(60, 40) and S(0, 40). Where should a water station go to make the total distance smallest? Justify. (4 marks: where the diagonals PR and QS cross, at (30, 20); total = PR + QS = 2 × √(60² + 40²) = 2 × 72.1 = 144.2 m) 3. For the same sites, where should a first-aid kit go to make the farthest walk as short as possible, and how far is that walk? (3 marks: (30, 20), 36.1 m, because all four corners are equally far from the centre of the rectangle) 4. A lawn is 16 m by 10 m and sprinklers reach 4 m. Use the grid rule to find the fewest sprinklers. (5 marks: 1 row fails because 10/2 = 5 > 4; 2 rows by 2 columns fails, √(4² + 2.5²) ≈ 4.72; 2 rows by 3 columns works, √(2.67² + 2.5²) ≈ 3.66; so 6 sprinklers) 5. A coverage checker shows 251 of 273 points covered. What percentage is that, and what should the designer do next? (3 marks: 251 ÷ 273 ≈ 91.9%; find where the uncovered points are, move or add a sprinkler there and test again) 6. Explain one advantage and one limitation of using a grid of test points to check coverage. (5 marks: advantage: it checks many points quickly and the same way every time; limitation: gaps smaller than 1 m between test points could be missed, and real sprinklers do not spray perfect circles; 1 mark for clear communication)
- Project brief (Lessons 7 to 9): Recommend a sprinkler layout for the 20 m by 12 m lawn to the groundskeeper. Include: your placement algorithm in numbered steps; the results of testing at least two designs with the coverage checker; one refinement you tried and what happened; your recommended layout with coordinates; one limitation.
- Project marking guide (16 marks): algorithm in clear numbered steps with a decision (4); test evidence for at least two designs with coverage percentages (4); a refinement explained (3); recommended layout with coordinates, justified (3); a relevant limitation (2).
- Devices with Google Sheets or Excel (one per pair), grid paper, sticky dots, rulers, compasses, calculators.