Part II · Chapter 6

Twenty Questions

Chopping a messy map into cleaner and cleaner rooms with simple yes/no splits.

Think back to the classic parlor game Twenty Questions. You have a mystery object in mind, and your friend tries to guess it using only simple Yes-or-No questions. "Is it bigger than a breadbox?" "Is it alive?" "Can it fly?"

A good player never wastes a question on a tiny detail right away. They ask a question that slices the remaining possibilities cleanly in two—so that each side becomes much easier to sort out.

A machine can play the exact same game on a map of dots. Instead of tilting a slanted line or asking neighbors to vote, it draws one straight laser-fence at a time—either straight up-and-down ("Left or Right of here?") or straight side-to-side ("Above or Below here?").

The Core Visual Idea

Every straight cut splits a messy, mixed room into two smaller rooms. What makes a cut good? It makes the two new rooms as pure—filled with just one color—as possible.

Make the Cleanest Cut

Below is a single mixed room containing Blue and Gold dots. Choose a Vertical Cut or a Horizontal Cut, then drag the glowing laser-fence across the room.

Watch the two Purity Bars underneath as you slide the fence. A half-and-half room is completely messy; a room filled with all Blue or all Gold is spotless. Try to find the cleanest single cut yourself—then click Find Purest Cut to see if the machine agrees!

Interactive Make the Cleanest Cut
Drag the glowing laser-fence to make both rooms as pure as possible
Left Room: — Mixed
Right Room: — Mixed

Notice that one single cut rarely finishes the job. You might get one spotless room on the left, while the room on the right still has a pocket of both colors mixed together.

So what do you do next? You step inside that messy room and ask another straight-line question—then another—until every room is tidy!

Watch the Rooms Divide Step-by-Step

Every time a room splits in two, our chain of questions branches like a family tree. Slide Number of Questions from 0 up to 4 below. Watch the 2D map slice into crisp glowing rooms on top, while the matching flowchart of Yes/No questions grows right underneath it.

Interactive Watch the Rooms Divide Step-by-Step
Step from 0 to 4 layers of questions and watch both the map and flowchart grow
Matching Flowchart of Questions
2 layers of questions carve clean, sensible rooms across the map.

Pause at 2 Layers, then slide up to 4 Layers. Something subtle—and deeply important—happens at the end.

With 2 or 3 layers of questions, the machine carves big, sensible rooms that match the true layout of the map. But when you allow 4 layers of questions, the machine starts building tiny closets around single stray dots. Those ultra-specific closets score a perfect mark on the dots already sitting on the map, yet they're fragile: a brand-new dot landing nearby could easily be tripped up by a closet built for one lone quirk.

Takeaway

By asking one simple straight-line question at a time and always picking the cut that makes the resulting rooms as pure as possible, a machine can slice even a tangled map into crystal-clear zones—as long as it knows when to stop chopping before it builds tiny closets around every quirk.

What do people call this in the wild? Optional: uncover the textbook names for rooms, cuts, and flowcharts.
The Game of Yes/No Splits
Decision Tree
A branching flowchart of simple Yes/No questions that sorts examples into final rooms (called "leaves").
Each Question Asked
Split / Node
A single checkpoint in the tree that divides the current room along one axis (like left vs. right).
How Mixed a Room Is
Impurity (Gini / Entropy)
Standard scores for measuring how jumbled a room is—zero when a room is completely one color, highest when it's an even mix.
How Many Layers of Questions
Tree Depth
The maximum number of questions asked in a row—limiting depth prevents the tree from carving tiny closets around single noisy dots.