ASCENTLEARNING
Join a weekly class
Skip to learning content
YEAR 7 · ANGLES AND POLYGONS · 15 MIN

Shape-sorting rules and simple algorithms

Turn shape definitions into ordered decisions, test the rules and repair a classification algorithm.

In this lesson

Before you start
  • Triangle and quadrilateral families
  • Reading conditions involving and/or
01 / LEARN

Understand the idea.

Make every decision precise

An algorithm is a finite sequence of precise instructions. A shape-sorting rule should test given or verified properties, such as side count, equal lengths and right angles. “Looks square” is unreliable because orientation and sketch accuracy can mislead.

Follow the supplied table in order and stop at its first output. An AND condition requires both properties. The square test therefore checks both four equal sides and four right angles before a broader rectangle or rhombus test can stop the process.

An ordered algorithm for four-sided shapes. Stop at the first output.
StepConditionOutput or next step
1Not exactly four sidesNot a quadrilateral; stop
2Four right angles AND four equal sidesSquare; stop
3Four right anglesRectangle; stop
4Four equal sidesRhombus; stop
5None of the earlier conditionsOther quadrilateral; stop

Test the boundaries, then improve the rules

Test ordinary cases and boundary cases: a square, a non-square rectangle, a non-square rhombus, another quadrilateral and a triangle. The triangle should stop at the side-count test before any four-sided classification is considered.

A counterexample shows why a proposed rule fails. Four equal sides alone do not guarantee a square: a rhombus without right angles passes that test. Add the right-angle condition and place this more specific test before the broader family tests.

02 / WORKED EXAMPLES

See the method in action.

EXAMPLE 01

Trace the decisions

Use the sorting table for a shape with four sides, four equal side lengths and four right angles.

Worked solution

  1. 1

    Trace the first condition.

    number of sides=4

    The shape has exactly four sides, so the “not a quadrilateral” output does not apply.

  2. 2

    Evaluate the square condition.

    The shape has both four right angles and four equal sides, so both parts of the AND condition are true.

  3. 3

    Output Square and stop.

    Step 2 succeeds; the ordered algorithm does not continue to the broader rectangle or rhombus rules.

Answer

Square.

EXAMPLE 02

Repair an early stop

A program first asks “Does the shape have four right angles?” and outputs Rectangle if yes. Why does this prevent it giving the most specific name for a square?

Worked solution

  1. 1

    Trace the original first test for a square.

    A square has four right angles, so the program immediately outputs Rectangle and stops.

  2. 2

    Compare that output with the requested precision.

    Rectangle is a correct family name, but Square is the more specific classification for this input.

  3. 3

    Insert the more specific test first.

    First require four right angles AND four equal sides; if both hold, output Square and stop. Otherwise continue to the rectangle test.

  4. 4

    Check both square and non-square rectangle cases.

    A square now stops at Square. A rectangle with unequal adjacent sides fails the square test and then correctly stops at Rectangle.

Answer

Check the square condition before the rectangle condition.

03 / YOUR TURN

Try it yourself.

Check your understanding

The table receives a triangle with two equal sides. What is its output?

Show answer & reasoning

Not a quadrilateral.

A triangle has three sides, so it satisfies step 1: not exactly four sides. The output is “Not a quadrilateral”, and the program stops before testing its equal sides.

Keep practising

6 worksheet questions · 14 marks

Read the questions online
  1. Use the sorting table for a four-sided shape with four right angles but not four equal sides. State the output.
    2 marks
    An ordered algorithm for four-sided shapes. Stop at the first output.
    StepConditionOutput or next step
    1Not exactly four sidesNot a quadrilateral; stop
    2Four right angles AND four equal sidesSquare; stop
    3Four right anglesRectangle; stop
    4Four equal sidesRhombus; stop
    5None of the earlier conditionsOther quadrilateral; stop
  2. Use the sorting table for a four-sided shape with four equal sides but no right angles. State the output.
    2 marks
    An ordered algorithm for four-sided shapes. Stop at the first output.
    StepConditionOutput or next step
    1Not exactly four sidesNot a quadrilateral; stop
    2Four right angles AND four equal sidesSquare; stop
    3Four right anglesRectangle; stop
    4Four equal sidesRhombus; stop
    5None of the earlier conditionsOther quadrilateral; stop
  3. The rule “If a shape has four equal sides, output Square” is incorrect. Give a counterexample and repair the condition.
    3 marks
  4. A five-sided polygon is given to the table. At which step does it stop, and what is the output?
    2 marks
    An ordered algorithm for four-sided shapes. Stop at the first output.
    StepConditionOutput or next step
    1Not exactly four sidesNot a quadrilateral; stop
    2Four right angles AND four equal sidesSquare; stop
    3Four right anglesRectangle; stop
    4Four equal sidesRhombus; stop
    5None of the earlier conditionsOther quadrilateral; stop
  5. Write an ordered side-based algorithm that gives the most specific name Equilateral, Isosceles or Scalene for a triangle.
    3 marks
  6. A four-sided shape has no right angles and not all sides equal. The table outputs Other quadrilateral. Does this prove it has no parallel sides? Explain.
    2 marks
Read the worked solutions

Equivalent correct methods earn the corresponding marks. Include units where asked.

  1. Use the sorting table for a four-sided shape with four right angles but not four equal sides. State the output.
    2 marks
    An ordered algorithm for four-sided shapes. Stop at the first output.
    StepConditionOutput or next step
    1Not exactly four sidesNot a quadrilateral; stop
    2Four right angles AND four equal sidesSquare; stop
    3Four right anglesRectangle; stop
    4Four equal sidesRhombus; stop
    5None of the earlier conditionsOther quadrilateral; stop

    Step 2 fails because the sides are not all equal.

    Step 3 succeeds because all four angles are right.

    Rectangle.
  2. Use the sorting table for a four-sided shape with four equal sides but no right angles. State the output.
    2 marks
    An ordered algorithm for four-sided shapes. Stop at the first output.
    StepConditionOutput or next step
    1Not exactly four sidesNot a quadrilateral; stop
    2Four right angles AND four equal sidesSquare; stop
    3Four right anglesRectangle; stop
    4Four equal sidesRhombus; stop
    5None of the earlier conditionsOther quadrilateral; stop

    Steps 2 and 3 fail because the angles are not all right.

    Step 4 succeeds because all four sides are equal.

    Rhombus.
  3. The rule “If a shape has four equal sides, output Square” is incorrect. Give a counterexample and repair the condition.
    3 marks

    A rhombus can have four equal sides without any right angles.

    Adding the right-angle condition distinguishes a square.

    A non-square rhombus is a counterexample. Require four equal sides AND four right angles.
  4. A five-sided polygon is given to the table. At which step does it stop, and what is the output?
    2 marks
    An ordered algorithm for four-sided shapes. Stop at the first output.
    StepConditionOutput or next step
    1Not exactly four sidesNot a quadrilateral; stop
    2Four right angles AND four equal sidesSquare; stop
    3Four right anglesRectangle; stop
    4Four equal sidesRhombus; stop
    5None of the earlier conditionsOther quadrilateral; stop

    Five is not exactly four.

    The first condition is true, so no later step is used.

    Step 1; Not a quadrilateral.
  5. Write an ordered side-based algorithm that gives the most specific name Equilateral, Isosceles or Scalene for a triangle.
    3 marks

    An equilateral triangle also has at least two equal sides.

    Therefore the all-three-equal condition must be tested before the broader at-least-two condition.

    First test all three sides equal: Equilateral. Otherwise test at least two equal sides: Isosceles. Otherwise: Scalene.
  6. A four-sided shape has no right angles and not all sides equal. The table outputs Other quadrilateral. Does this prove it has no parallel sides? Explain.
    2 marks

    Other quadrilateral means only that earlier categories were not selected.

    For example, a non-rectangular parallelogram with unequal adjacent sides reaches that output.

    No. The table has not tested parallel sides.
Checking saved progress…
Curriculum reference & lesson scope

Australian Curriculum v9 / SA Mathematics

Year 7 angle relationships, polygon properties and classification algorithms. Chapter grouping follows the approved Ascent outline.

Official curriculum source ↗

Save your next step.

Create a free account to save your learning progress. Lessons and downloads stay free, with or without an account.

Create free account