An algorithm is a list of steps with decisions. Write the rule for whether three strips can make a triangle as steps, and mark which are computations and which are decisions.
A cutting machine is given three strip lengths for a triangular frame. How does it know the frame will close?
A cutting machine makes triangular frames from three strips. Before it cuts, a program should check that the three lengths can really make a triangle. The rule from geometry is that the two shorter strips together must be longer than the longest one. An algorithm turns that rule into exact steps: some steps compute a number, and some decide between two paths. Have a guess whether 3, 4 and 8 can make a triangle, and we'll come back to the machine at the end.
How this lesson works: Predict, Try, Investigate, Modify, Practise, Make
Predict: Read the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Try: Try it on the board and compare the result with your prediction.
Investigate: Work out why it happens, one step at a time.
Modify: Change the problem on purpose and see what happens.
Practise: A few on your own, to check you have it.
Make: Make your own problem using what you have learned. Expect a few tries; that is normal.
Make your prediction first. Help opens once you've locked it in.
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
3, 4 and 8
TryTry it on the board and compare the result with your prediction.
The sum of the short strips
The strips are 5, 7 and 13. What is the sum of the two shorter strips?
InvestigateWork out why it happens, one step at a time.
Computations and decisions
Worked exampleBefore each step, say what you think comes next.
Read a,b,cInput.
L=max(a,b,c),S=a+b+c−LTwo computation steps.
S>L? triangle : no triangleOne decision with two branches.
Build up to it
Run the algorithm on 5, 6 and 10. What is S, the sum of the two shorter strips?
Lena writes her own algorithm. Test it on 8, 2 and 3. Click the step that makes it fail.
ModifyChange the problem on purpose and see what happens.
Change the algorithm
The strips are 4, 4 and 9. What is S minus L? (A negative means it cannot close.)
PractiseA few on your own, to check you have it.
Steps and results
Strips 6, 9 and 14. By how much does S exceed L? (Negative if it falls short.)
Review: a shape is enlarged by scale factor 3. How many times bigger is its area?
MakeMake your own problem using what you have learned. Expect a few tries; that is normal.
Check the machine's strips
Write the algorithm in your own words as numbered steps and mark the decision.
Also used in
Bird keys. The Year 7 and 8 bird key is the same kind of algorithm: each question is a decision, and the answer is a name instead of "triangle".
Computer graphics. A program checks a mesh triangle is valid before it draws it.
Building and design. Frames, trusses and kites use triangles because the sides must satisfy this rule.
Next lesson. Testing the algorithm with awkward cases to find where it fails.
The machine is asked for strips of 5, 7 and 13. Follow the algorithm and find how many units too short the two shorter strips are (L − S). (The lengths are made up for the task.)
Work it out on paper first, one step per line. Then type your answer.
Put your page beside this and compare, step by step.
An algorithm is a list of steps with decisions. Write the rule for whether three strips can make a triangle as steps, and mark which are computations and which are decisions. About 40 minutes.
Students need triangles and the Year 7 and 8 classifying algorithms.
The one idea: an algorithm is exact steps, some computing, some deciding. Pseudocode is used here; a flowchart is a drawing of the same steps (a diamond for each decision). Lengths are made up.
Running the lesson
Predict: show of hands before the check.
Make: the working is done on paper first.
The hard part (on purpose)
Writing vague steps like "check the strips". Ask: what exactly does a machine compute, and what does it compare?
When students get stuck
A student writes "check the lengths". Ask: Which two numbers does the machine compare? Fix: Name the numbers and the comparison.
Stretch and support
Stretch: Write the same algorithm as a flowchart, then as pseudocode with a loop that tests a list of strip sets.
Support: A printed copy of the situation and a blank table to fill in.
Where it leads
Starts AC9M9SP03 node 1.
Where it leads: testing with awkward cases (next).
What each step is for
3, 4 and 8: Guessing whether 3, 4 and 8 close shows whether students compare the two short strips with the long one or look only at the numbers.
the sum of the short strips: The rule needs one number from the two shorter strips; computing it is a step of the algorithm.
computations and decisions: An algorithm has computation steps (find a number) and decision steps (choose a path), and every step must be exact enough for a machine; a rule that checks only one pair is not the whole algorithm.
change the algorithm: Adding a step or a second decision to the same algorithm, and writing it as a flowchart.
steps and results: Running the algorithm on cases and naming its parts, then a review of the Year 9 enlargement.
check the machine's strips: Returning to the machine: use the algorithm on a real order, on paper.