Categorisation, attribute matching, and set logic are the foundations of both mathematics and computational thinking. A pile of mixed bricks is a dataset.
A pile of 80 mixed LEGO bricks is, technically, a dataset. It contains objects with multiple attributes — colour, size, shape, stud count — and any of those attributes can serve as a sorting key.
When a five-year-old sits down and starts sorting, they're not tidying. They're writing their first query.
In formal mathematics, sorting is a subset of set theory — the branch concerned with collections of objects and the rules for grouping them. Long before children encounter set notation, they reason about sets naturally when they sort.
Sorting by colour produces a partition: every brick belongs to exactly one colour group, and all bricks are accounted for. That's a mathematical property your child discovers empirically, without anyone explaining it.
More interesting is what happens when children sort by multiple attributes — or when they encounter a brick that belongs to two categories at once.
"This brick is blue and big. Where does it go?"
That question — which arises naturally during free sorting — is the preschool version of an intersection: a brick that satisfies two conditions simultaneously. Children who engage with this question are doing informal Boolean logic.
Age 4 — Single attribute: Give a pile of bricks and a rule: "Sort by colour." One rule, one attribute. Observe whether the child is consistent, and whether they can tell you their rule when finished.
Age 5 — Attribute switch: Sort first by colour, then say "Now sort the same bricks by size." The ability to re-sort an already-sorted pile by a different rule is a significant step — it requires suppressing the previous category structure and rebuilding from scratch.
Age 5–6 — Two-way sort: Create a simple Venn diagram on the floor using two large rings of string. "These are blue bricks. These are big bricks. Where do the big blue bricks go?" The child who places them in the overlap has grasped intersection without being taught it.
Categorisation is a foundational cognitive operation across domains:
Language: Words are categories. The concept "dog" is a set of objects that share certain attributes. A child who can articulate sorting rules is practising the same abstraction process used in vocabulary acquisition.
Coding: Conditionals in programming are sorting logic made explicit. if colour == "red" is a sorting query. Children who have an intuitive model of attribute-based grouping find this pattern familiar when they encounter it later.
Science: Taxonomy — classifying living things — is sorting with nested categories. The child who asks "can a brick be in two groups?" is already thinking about how classification systems handle edge cases.
The language you use during sorting sessions has measurable impact on the cognitive work being done. Some prompts that deepen the experience:
The pile of bricks on your floor contains more mathematics than most preschool workbooks. The child sorting it is not playing adjacent to learning. They are learning — in the most direct sense — how to impose structure on unstructured information.
That, in one sentence, is what data science is.