AC9M7SP04 · Year 7 · Space

Algorithms to sort and classify shapes

ACARA v9 CONTENT DESCRIPTION design and create algorithms involving a sequence of steps and decisions that will sort and classify sets of shapes according to their attributes, and describe how the algorithms work

Once you can classify shapes by their properties, you can teach a clear procedure to do it automatically. An algorithm is a precise sequence of steps and decisions that completes a task, and writing one to sort and classify shapes is a perfect way to make your geometric reasoning explicit. This year you learn to design and create such algorithms, and to describe clearly how they work.

Turning a classification into an algorithm forces you to be exact. A vague sense of what makes a square will not do; you have to spell out the precise questions, in the right order, that distinguish every shape from every other. This is the same kind of thinking that underlies all of computing.

Decisions as a tree

A natural way to design a classification algorithm is as a decision tree. You start with a question about an attribute, such as does this shape have four sides. Each answer, yes or no, sends the shape down a different branch, where the next question waits. A shape without four sides might be classified by counting its sides; a shape with four sides leads to further questions about its angles and side lengths. Following the branches from top to bottom always arrives at a single, correct category.

A classification decision tree
A series of yes/no questions about attributes sorts a shape into its category.
An algorithm to classify shapes can be drawn as a decision tree. Each branch asks a yes or no question about an attribute, such as does it have 4 sides, and the answer sends the shape down one path. Following the branches leads to the correct category.

The power of the tree is that each question narrows the possibilities, so only a few well-chosen questions can distinguish many shapes. The order of the questions matters: asking about the number of sides first makes sense, because the later questions about right angles only apply once you know you are dealing with a quadrilateral. Designing the questions and their order is the creative heart of building the algorithm.

Writing and describing the steps

The same logic can be written as an ordered list of steps, some of which are decisions. Step one might be to count the sides; step two, if there are not four, to classify by side count and stop; step three, if there are four, to check the angles and sides; step four, to name the quadrilateral accordingly. Written this precisely, the algorithm could be followed by another person or carried out by a computer, with no guesswork.

The algorithm as steps
The same logic can be written as a numbered sequence of steps and decisions.
The same classification can be written as an ordered algorithm: a numbered list of steps, some of which are decisions. Step by step it counts sides, makes decisions, and arrives at a name. Written this clearly, anyone, or any computer, could follow it.

Being able to describe how the algorithm works is as important as creating it. A clear explanation lets someone else follow the steps, check that the logic is correct, and suggest improvements, perhaps a shorter path or a question in a better order. This blend of geometric knowledge and step-by-step logical design is exactly the kind of computational thinking the curriculum is building, and it connects the shapes you classify by eye to the precise procedures that power software, sorting and searching of every kind.

Teaching tip: play a guess-the-shape game where the student may only ask yes or no questions about attributes. The questions they choose, and the order they ask them in, are an algorithm in the making. Afterwards, write the questions down as a decision tree together to see the algorithm take shape.

Emphasise precision and order. Ask what happens if a step is missed or two steps are swapped, so the student sees that an algorithm only works when every step is clear and correctly sequenced. Describing each step in plain words is the habit that makes algorithmic thinking reliable.

Builds on: Classifying triangles, quadrilaterals and polygons (AC9M7SP02). That unit classified shapes by their properties; this unit builds step-by-step algorithms to sort and classify them automatically.
Quick self-check
1. What is an algorithm?
2. In a classification decision tree, each branch represents
3. An algorithm classifies a shape: it has 4 sides, all equal, all angles 90 degrees. The result is
4. Why must the steps of an algorithm be in a sensible order?
5. A good reason to describe how an algorithm works is so that