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.

01 / LEARN

The idea, step by step

Make every decision precise

An algorithm is a finite list of instructions that can be followed consistently. A shape-sorting algorithm uses observable or given properties, such as the number of sides, equal lengths and right angles. Avoid instructions like “looks like a square”, because a rotated drawing may mislead.

Read an AND condition carefully: both statements must be true. In the ordered table, stop when a condition gives an output. This ensures a square receives the most specific name before the broader rectangle rule can catch it.

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 special cases. The table should identify a square, a non-square rectangle, a non-square rhombus and a general quadrilateral. Also test a triangle: it should stop at step 1 instead of falling through to a four-sided category.

A counterexample exposes a faulty rule. “Four equal sides means square” fails for a slanted rhombus. Repair it by requiring four right angles as well. You can express the same algorithm as a flowchart or implement its decisions in a simple program; the mathematical tests must stay the same.

A common trap

Any order of correct shape definitions gives the same most specific classification.

Instead: With an early stop, order matters. A square satisfies the rectangle rule too, so the square test must come first if the most specific name is required.

02 / WORKED EXAMPLES

See the thinking

Example 1

Trace the decisions

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

  1. Step 1 does not apply because there are four sides.
  2. Both conditions in step 2 are true.
  3. Output Square and stop; do not continue to the broader rectangle or rhombus checks.
Square.
Example 2

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?

  1. A square has four right angles, so it stops at Rectangle.
  2. The output is a true family name but not the most specific name requested.
  3. Test four right angles AND four equal sides first; if both hold output Square. Then test the general rectangle condition.
Check the square condition before the rectangle condition.

Check your understanding

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

Show answer

Not a quadrilateral.

It has three sides, so step 1 applies. The algorithm stops before testing equal sides or angles.

03 / WORKSHEET

Your turn

6 questions · 14 marks · Work at your own pace.

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…

Ready for the topic test?

Review the chapter, then choose a practice test.

Topic review
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 ↗
Back to Angles and polygons

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