Branching databases: yes or no questions
Computer Science · Key Stage 2 · The School
Splitting a group in two
A BRANCHING DATABASE sorts things using yes or no questions. Each question splits the group into two smaller groups. Ask enough questions, and you end up with just one thing left. It works for animals, for shapes, for almost anything that can be sorted. The same idea sits behind many simple identification guides used outside a classroom too. A field guide to birds often works in exactly this way.
A good question splits evenly
A good question splits a group roughly in half. "Does it have four legs?" splits animals well. "Is it a dog?" only pulls out one animal, leaving everything else in a huge pile. Better questions save more later questions. A branching database built from good questions reaches its answer in far fewer steps. Choosing the right first question matters more than any question that follows it.
Following the branches
Start at the top with every item. Ask the first question. Follow the YES branch or the NO branch, depending on the answer. Keep going, question after question, until only one item is left. Each branch you follow removes a whole group of items you no longer need to think about.
Identifying a mystery animal
Does it live in water? YES. Does it have scales? YES. Does it have legs? NO. Following those three answers down the branches leaves only one creature: a fish. Each question removed everything that did not match, until one answer remained. Just three short questions were enough to name it exactly.