Lesson 100 — Designing an Algorithm to Identify Congruency
Strand: Space | Descriptor: AC9M8SP04 | Duration: 45 minutes
Equipment: rulers, protractors.
Learning Intentions
- To understand computational thinking concepts: sequence, and decision (branching) steps.
- To design a step-by-step algorithm that determines whether two triangles are congruent, based on measured sides and angles.
Success Criteria
I can:
- Explain the difference between a sequence step and a decision step in an algorithm.
- Recall the four triangle congruence conditions — SSS, SAS, AAS, RHS — from AC9M8SP01.
- Design a step-by-step algorithm (flowchart or pseudocode) that inputs triangle measurements and outputs whether the triangles are congruent.
- Describe, in plain language, how my designed algorithm works.
Warmup
(5 minutes — sort the steps, pairs)
Here are six instructions for making toast, in scrambled order:
- Put the toast on a plate.
- If the toast is not dark enough, press the lever down again.
- Put bread in the toaster.
- Press the lever down.
- If the toast is dark enough, take it out.
- Wait until the toaster pops or you check it.
- Put them into a sensible working order.
- Which of the six steps are plain instructions (do this, then that), and which are decisions (ask a yes/no question and choose what happens next)?
Answers: 1. Bread in toaster → press lever → wait → check darkness (decision) → take out or press again → plate. 2. Instructions: “put bread in”, “press lever”, “wait”, “put on plate”. Decisions: “is it dark enough?” — this is the only step where the next action depends on a yes/no answer.
Why this matters today: every algorithm — including the one you’ll design today — is built from exactly these two kinds of steps.
Activities
Activity 1 — Explicit Instruction: Sequence and Decision Steps (10 min)
I do: Define the two building blocks of any algorithm:
| Step type | What it does | Shown as |
|---|---|---|
| Sequence step | A plain instruction carried out in order, no choice involved | A rectangle in a flowchart; a plain line in pseudocode |
| Decision step | Asks a yes/no (or true/false) question, and branches — sends the algorithm down a different path depending on the answer | A diamond in a flowchart; an IF … THEN … ELSE in pseudocode |
Model a simple two-step decision algorithm for “is a number even?”:
INPUT: a whole number n
IF n is divisible by 2 THEN
OUTPUT "even"
ELSE
OUTPUT "odd"
END IF
As a flowchart:
START
|
v
<n divisible by 2?>
Yes | | No
v v
[OUTPUT even] [OUTPUT odd]
STOP STOP
We do: Together design a two-step decision algorithm for “does a triangle contain a right angle?” using measured angles as input. Write it as pseudocode together.
You do: Design a simple decision algorithm (pseudocode or flowchart) for “is a triangle isosceles?”, given the three side lengths as input. Compare with a partner — did you both choose the same decision condition?
Activity 2 — Guided Design: Recalling the Congruence Conditions (10 min)
Recall from AC9M8SP01 the four standard tests for triangle congruence. Complete this table together as a class recap before designing today’s algorithm:
| Condition | What must match | Shorthand |
|---|---|---|
| Side-Side-Side | All three sides | SSS |
| Side-Angle-Side | Two sides and the included angle between them | SAS |
| Angle-Angle-Side | Two angles and a corresponding side | AAS |
| Right angle-Hypotenuse-Side | A right angle, the hypotenuse, and one other side | RHS |
I do: Model turning one condition into a decision step. For SSS: “Do all three sides of triangle 1 equal all three sides of triangle 2 (matching lengths, in any correspondence)? Yes → congruent by SSS.”
We do: Together turn the SAS condition into a decision step, being careful to state the word included explicitly (previewing why this word matters — it will be tested for a hidden flaw in the very next lesson). “Do two sides and the included angle of triangle 1 equal two sides and the included angle of triangle 2? Yes → congruent by SAS.”
You do: Write decision steps, in your own words, for the AAS and RHS conditions, following the same pattern.
Activity 3 — Design Task: Building the Full Congruency Algorithm (16 min)
Pairs. You have four decision steps — one for each congruence condition. Today’s design task is to chain them together into a single working algorithm that takes any two triangles’ measurements as input and decides whether they are proven congruent.
Design brief. Your algorithm must:
- Take as input the side lengths and angles of two triangles (however many measurements are known).
- Check the conditions in some order — you choose the order, but you must be able to justify it.
- Branch after each check: if a condition is satisfied, output which congruence rule proved it, and stop; if not, move to the next check.
- If none of the four conditions are satisfied, output “not proven congruent”.
- Be represented in at least one of: a flowchart (labelled sketch is fine) or pseudocode. Stronger pairs should attempt both.
Design decisions to discuss and justify in writing:
- Does the order you check the four conditions in matter for the final answer? (Think carefully — will a different order ever change whether the algorithm outputs “congruent” versus “not proven congruent”?)
- What is the very last step your algorithm needs, for triangles that satisfy none of the four conditions?
Socratic scaffolding:
| Prompt | Purpose |
|---|---|
| Understand: what does the finished algorithm need to input, and output? | Input: two sets of triangle measurements. Output: a congruence rule, or “not proven”. |
| What do you know about the four conditions individually? | Each is already written as a single decision step from Activity 2. |
| Devise a plan: how do decision steps chain together when the answer to one is “No”? | Each “No” branch leads into the next decision step, not straight to “not proven” — only the final “No” reaches that. |
| Carry it out | Draw or write the full chain, testing it against a triangle pair you already know is congruent by SAS. |
| Looking back | Trace a triangle pair that is not congruent through your whole algorithm — does it correctly reach “not proven congruent” only at the very end? |
Test your design by tracing it through with this triangle pair:
Checks for Understanding
(6 minutes — exit ticket, collected)
- Give an example of a sequence step and a decision step from everyday life (not toast or triangles).
- State the four triangle congruence conditions your algorithm should test for.
- In a flowchart, what shape represents a decision step, and what shape represents an instruction step?
- Reasoning. Explain why an algorithm for congruency needs a final “not proven congruent” output, rather than assuming every triangle pair must match one of the four conditions.
Answers: 1. E.g. sequence: “put on your shoes”; decision: “if it’s raining, take an umbrella.” 2. SSS, SAS, AAS, RHS. 3. Decision = diamond; instruction = rectangle. 4. Many triangle pairs genuinely are not congruent, or don’t have enough matching measurements provided to prove congruency even if they happen to be — the algorithm must have a defined output for this case rather than looping forever or crashing with no answer.
Common Misconceptions
| Misconception | How to pre-empt it |
|---|---|
| Believing “decision” steps and “sequence” steps are the same thing. | Contrast the toast example’s plain instructions against its one yes/no check explicitly. |
| Designing an algorithm that checks all four conditions independently rather than chaining them with “No” branches. | Model that each “No” branch leads to the next check, not to four separate parallel questions. |
| Forgetting the word “included” when describing SAS, leaving the condition too generous. | Flag this explicitly as a design choice worth extra care — it is revisited as a deliberate test case next lesson. |
| Assuming the order of checking the four conditions changes which triangles are found congruent. | Discuss as a class: the order can change how quickly an answer is reached, but not whether a true congruence is eventually found, since all four are checked before giving up. |
| Believing “not proven congruent” is the same as “proven not congruent”. | Preview this distinction briefly; it becomes a full focus of the next lesson. |
Enrichment — Competition-Style Problems
E1 (Kangaroo style). An algorithm checks SSS first, then SAS, then AAS, then RHS. A triangle pair actually satisfies both SSS and SAS. What does the algorithm output, and why is this not a problem?
Answer
It outputs “congruent by SSS”, since that check happens first and the algorithm stops as soon as one condition is satisfied. This is not a problem because the conclusion (the triangles are congruent) is correct either way — the algorithm simply reports whichever valid proof it reaches first, not necessarily every proof that would work.
E2 (AMC Junior style). A student designs an algorithm with only three decision steps (SSS, SAS, AAS) and forgets RHS entirely. Construct a specific pair of right-angled triangles that this incomplete algorithm would incorrectly report as “not proven congruent”.
Answer
Two right-angled triangles with hypotenuse
E3 (Challenge). Explain, using the idea of sequence and decision steps, why a flowchart and a piece of pseudocode for the exact same algorithm will always trace to the same output for the same input, even though they look completely different.
Answer
Both forms are built from exactly the same underlying sequence and decision steps — a flowchart’s diamonds and rectangles and pseudocode’s IF…THEN…ELSE structures are simply two different notations for identical logic. Since neither notation changes what the steps actually check or in what order, tracing the same input through either form must follow the same path of decisions and reach the same output.
Homework
- Give two more real-life examples of a decision step (other than the ones used in class).
- Write, in plain language, the decision step for the RHS congruence condition.
- Draw a simple flowchart (boxes, diamonds, arrows) for an algorithm that decides “is a triangle equilateral, isosceles, or scalene?” given its three side lengths.
- Trace your Q3 algorithm using the sides
cm, cm, cm. State the output. - Reasoning. Explain why an algorithm needs to be tested on more than one example triangle pair before you can be confident it works — think about a triangle pair that satisfies none of the four conditions.
- Challenge. Design (in pseudocode or a flowchart) a two-step decision algorithm that first checks if two triangles have the same three angles (but not necessarily the same size), and outputs “similar” — this connects triangle similarity conditions (AA) to today’s congruency work. Explain in one sentence why this algorithm needs only one condition, unlike the four needed for congruency.
Answers: 1. E.g. “if the traffic light is red, stop”; “if you have homework, do it before your favourite show.” 2. “Do both triangles have a right angle, matching hypotenuse length, and one other matching side? Yes → congruent by RHS.” 3. Decisions should check: all three sides equal → equilateral; exactly two sides equal → isosceles; otherwise → scalene. 4. All three sides equal (IF two angles of T1 equal two angles of T2 THEN OUTPUT "similar" ELSE OUTPUT "not proven similar" — similarity only requires matching shape (angles), not matching size (sides), so a single AA condition is sufficient, unlike the four separate side-and-angle combinations needed to guarantee congruency.