⟁ THREAD 3 — ANALOG LOGIC & ALGORITHMS · MODULE 3
S Science T Technology E Engineering A Arts M Mathematics

The Gravity-Fed
Logic Sorter

An algorithm is just a series of decisions. "If this is true, do X. If false, do Y." Before computers used microchips for this, engineers used physical thresholds. Build a gravity-fed sorter and construct a physical IF/THEN algorithm that processes data without a single line of code.

Middle School · Ages 12–14 Project Duration: One afternoon No electricity required
HOW DO YOU LEARN BEST?
TRY IT FIRST

Tolerance Simulator — Find the Bug

M · Mathematics · E · Engineering

Before you build anything, see what happens when a hole is cut too big. Drag the slider to set your small-hole tolerance, then drop a penny and see what happens.

⟁ Live Sorter Simulator

Choose your data type, set the tolerance, then drop an object and watch it sort
Node 1: Small? Node 2: Medium? BIN 1: Small BIN 2: Medium BIN 3: Large
RESULT Choose your data and drop an object to test the algorithm.
Try This Set the tolerance slider near maximum (+2.0mm) with Real US Coins selected, then drop a Penny. Watch what happens. This is the exact bug a first version of this guide nearly shipped with — a tolerance wider than the real gap between a dime and a penny.
PART 1

What This Is

S · Science · T · Technology

Every computer program in the world relies on conditional logic — the ability of a machine to look at a piece of data, ask a question about it, and decide what to do next. In programming, this is an IF/THEN/ELSE statement.

A vending machine sorts mixed coins instantly without cameras or lasers — it uses a physical algorithm. Coins roll down a ramp over a series of holes. The machine asks: "Is this smaller than this threshold?" If TRUE, it drops. If FALSE, it rolls to the next question.

PART 2

The Real Numbers — Why This Is Hard

M · Mathematics

A US dime measures 17.91mm across. A US penny measures 19.05mm across. The gap between them is only 1.14mm.

Gap = 19.05mm − 17.91mm = 1.14mm

A tolerance of +1.5mm — which sounds small and safe — is actually larger than the entire gap between these two coins. Built that way, a penny can squeeze through a hole meant only for dimes.

ObjectDiameterGap to Next Size
Dime17.91mm1.14mm to Penny
Penny19.05mm5.21mm to Quarter
Quarter24.26mm
The Fix Use washers instead of coins — you choose the gaps yourself, with as much safety margin as you want. If you do use real coins, the small-hole tolerance must stay well under 1.14mm (around 0.4mm is build-safe), which takes real precision to cut by hand.
PART 3

The Flowchart of Gravity

M · Mathematics · T · Technology

A flowchart is a map of an algorithm. A diamond represents a decision (True/False); a rectangle represents an action. Your ramp is a 3D version of this exact flowchart.

       [ INPUT: Mixed Objects ]
                │
                ▼
         /───────────\
       / IS IT SMALL?  \
      \   (< threshold) /
        \───────────/
         │         │
  (TRUE) │         │ (FALSE)
         ▼         │
  [ BIN 1: SMALL ]  │
                    ▼
             /───────────\
           / IS IT MEDIUM? \
          \   (< threshold) /
            \───────────/
             │         │
      (TRUE) │         │ (FALSE)
             ▼         │
   [ BIN 2: MEDIUM ]   │
                       ▼
                [ BIN 3: LARGE ]

Order matters. If the questions were asked largest-first, every object would get caught by the first question — exactly the bug you can test in the simulator above.

The Full Module — Reading Mode

What This Is

Every computer program in the world relies on conditional logic — the ability of a machine to look at a piece of data, ask a question about it, and decide what to do next based on the answer. In programming, this is called an IF/THEN/ELSE statement. If you dump a handful of mixed coins into a standard vending machine, it sorts them instantly without cameras or lasers — it uses a physical algorithm. The coins roll down a ramp over a series of holes, and the machine asks a physical question at each one: is this object smaller than this threshold? If true, it drops through; if false, it rolls on to the next question. You're going to engineer a physical logic board that executes a sequential sorting algorithm using nothing but gravity, geometry, and careful measurement.

A Tolerance Correction

A first pass at this project used real US coins with a flat 1.5mm tolerance added to every hole size. That doesn't actually work, and the reason is the whole engineering lesson of this module. A US dime measures 17.91mm across. A US penny measures 19.05mm across. The gap between them is only 1.14mm — smaller than a flat 1.5mm tolerance. Built that way, a penny would be able to squeeze through the hole sized for a dime, which is exactly the failure this project's troubleshooting normally warns against, except caused by a measurement error in the plan itself rather than the builder. This guide recommends washers instead, since the builder gets to choose generous, foolproof gaps rather than being constrained by the accidents of US currency sizing, and provides a corrected, much tighter coin tolerance as an alternative for anyone who wants the history and familiarity of real currency.

The Concept

When a computer sorts a list of numbers from smallest to largest, it runs an algorithm that compares two pieces of data at a time, asking: is A smaller than B? A sorting machine asks a series of physical questions, and the order of those questions matters as much as the questions themselves. If you roll three sizes of object over a large-sized hole first, everything falls in — the machine fails because the logic is out of order. To sort correctly, the algorithm must process data from the smallest threshold to the largest: is it smaller than the small threshold (smallest objects drop, others continue), then is it smaller than the medium threshold (medium objects drop, the largest continues), then else — the largest object reaches the end of the track. This sequence prevents data from being miscategorized, exactly how software engineers structure code to prevent bugs.

The Flowchart of Gravity

A flowchart is a map of an algorithm. In computer science, a rectangle represents an action, and a diamond represents a decision — a true or false question. A physical sorting ramp is a three-dimensional version of this exact flowchart. Every hole cut into the ramp is a decision diamond: if the object is smaller than the hole, the answer is true and it drops; if the object is larger, the answer is false and it rolls across the gap to the next question.

Why Order Matters — The Deeper Lesson

This project's real lesson isn't actually about coins or washers — it's about a principle that shows up constantly in real software: the order conditions are checked in can change whether a program works at all, even when every individual condition is written correctly. A programmer who checks conditions in the wrong order produces exactly the bug visible on a poorly-ordered ramp: everything gets caught by the first matching rule, even data that should have kept going. This is one of the most common real bugs in actual software, made physical and visible through gravity and cardboard.

The Arts-as-Attention Pass

An engineer who builds a machine without documenting the logic has built a puzzle, not a tool. After testing the ramp with a mixed handful of sorting objects, the builder must translate the physical machine back into the abstract language of computer science: drawing the flowchart that exactly matches the built machine, labeling each decision diamond with the precise millimeter measurements of the holes cut, and writing a brief explanation of why the holes must be ordered from smallest to largest. The final test is handing the manual and a handful of sorting objects to a friend — if they can operate and understand the machine using only the written documentation, the Arts-as-Attention pass succeeds.

Field Engineering: Step by Step

STEP 1
Choose Your Data. Washers (recommended) with generous size gaps you control, or real US coins with the corrected tight tolerance from the Show Me tab.
STEP 2
Measure Your Chosen Data. Use a millimeter ruler to measure the exact diameter of each size. Record every measurement before doing any math.
STEP 3
Calculate Your Tolerances. Confirm your small hole size is strictly smaller than your medium object, with real margin — use the simulator on the Show Me tab to test your numbers before cutting anything.
STEP 4
Build the Ramp. Cut a long, straight piece of cardboard (about 4 inches wide, 18 inches long) as your track base.
STEP 5
Cut the Logic Gates. About 4 inches down the track, cut a rectangular slot matching your calculated small tolerance size. About 10 inches down, cut a slot matching your medium tolerance size.
STEP 6
Install Guide Rails. Glue two long, thin cardboard strips along the left and right edges of the track to keep rolling objects centered over the holes.
STEP 7
Set the Pitch. Prop the top of the ramp on books. Place a bin under each hole and one at the very end.
STEP 8
Test, Troubleshoot, Document. Run a mixed handful through. If sorting fails, recheck your tolerance math before re-cutting. Draw your flowchart and write your manual once the machine sorts correctly every time.

Build It For Real

Materials

Sturdy Cardboard / Foam Core
For the ramp track and guide rails.
Craft Knife
For cutting clean, precise holes — adult supervision recommended.
Millimeter Ruler
Precision matters here — use mm markings, not just inches.
Hot Glue or Tape
For attaching guide rails.
Three Sizes of Washers
Recommended — choose generous size gaps yourself.
Or: Dime, Penny, Quarter
Real coins — requires the tighter corrected tolerance.

Recommended Washer Sizes

SizeSuggested DiameterGap to Next
Small12mm6mm to Medium
Medium18mm7mm to Large
Large25mm

Complete Project Checklist

Phase 1 — Mathematics & Tolerances

  • Decided: washers (recommended) or real coins
  • Three distinct sizes of data gathered and measured precisely in mm
  • Tolerance calculated for the small and medium holes
  • Verified the small tolerance hole is strictly smaller than the medium object, with real margin
  • Verified the medium tolerance hole is strictly smaller than the large object, with real margin
  • Tested numbers in the live simulator before cutting anything

Phase 2 — Engineering the Algorithm

  • Cardboard ramp base cut
  • Node 1 (smallest hole) cut precisely
  • Node 2 (medium hole) cut precisely, further down the track
  • Guide rails installed to prevent data from derailing
  • Pitch of the ramp adjusted to allow smooth, controlled rolling speed

Phase 3 — The Arts-as-Attention (Documentation)

  • Machine tested successfully with all three sizes
  • Algorithmic flowchart drawn in notebook, featuring diamonds for decisions
  • Tolerances and measurements labeled on the flowchart
  • Paragraph written explaining why sequential ordering is necessary
  • Tested successfully by a friend using only the written manual