Part 14 of 39

The Mega-Location

By Madhav Kaushish · Ages 10+

Glagalbagal's reputation had reached the chieftain, who offered him a vast tract of land to the north — the Thjervak Plains, a sweeping grassland larger than his three existing locations combined. The catch was that the chieftain wanted it operational within two months, producing a herd count by Hrijpa.

The Thjervak Plains were too large for a single manager. Glagalbagal divided the land into four regions, each run by a regional manager. But two of the regions were themselves enormous, so those managers divided their regions into sub-regions, each with a sub-manager. One sub-region was large enough to require its own sub-sub-managers.

The result was a hierarchy: Glagalbagal at the top, four regional managers below him, sub-managers below some of them, and sub-sub-managers below one of those. Each manager at the bottom level — the ones actually overseeing animals — had a basket system and a counting tablet. The question was how to get the total count for the entire Thjervak Plains.

The Obvious Approach

Glagalbagal's first plan was straightforward: collect the basket arrangements from every bottom-level manager, bring them all to a central location, and add them up.

But there were eleven bottom-level managers spread across a vast area. Sending pterodactyls to collect eleven separate arrangements, transporting them without error, and then performing ten additions (each with potential carrying mistakes) was slow, expensive, and fragile. By the time all arrangements arrived, some would be days old and no longer accurate.

Qveshna (who had been promoted to oversee the Thjervak project): Why not let each regional manager add up their own sub-managers' counts? Then you only need to collect four arrangements — one per region — and add those.

This was better. Each regional manager already knew their sub-managers. They could add locally and report a single regional total upward. Glagalbagal would then add four regional totals instead of eleven individual ones.

The Instruction

But Glagalbagal needed to write an instruction tablet for this process. The tablet had to work for every manager in the hierarchy, regardless of their level — a regional manager with three sub-managers, a sub-manager with two sub-sub-managers, or a bottom-level manager with no one below them.

He thought about it for a while and wrote:

To get the count for your region: Step 1. Collect the count from each of your sub-managers. Step 2. Add all the counts together using the Addition Tablet. Step 3. Report the result upward.

He distributed copies to every manager in the hierarchy.

The Confused Sub-Sub-Manager

The regional managers followed the tablet smoothly. They asked their sub-managers for counts, added them, and reported upward. The sub-managers did the same with their sub-sub-managers. But the sub-sub-managers — the ones at the very bottom, who had actual animals and baskets — were confused.

A sub-sub-manager named Plovjik (an ankylosaur of considerable stubbornness) sent a carrier pterodactyl to Glagalbagal with a complaint:

Plovjik's message: The tablet says to collect the count from each of my sub-managers. I do not have sub-managers. I have sheep. What do I collect from the sheep?

The instruction assumed that every manager had sub-managers. At the bottom of the hierarchy, this assumption was false. Plovjik had no one to collect from — she had animals to count directly. The tablet did not say what to do in her situation.

Glagalbagal had written a procedure that worked at every level of the hierarchy except the one that mattered most — the bottom.

Plovjik the ankylosaur staring at a herd of sheep, then at her instruction tablet, then back at the sheep, looking perplexed

The Revised Tablet

Glagalbagal added a single line at the top:

Step 0. If you have no sub-managers, count your animals directly using the Counting Tablet and report the result upward. Otherwise, proceed to Step 1.

The revised tablet now worked at every level. A bottom-level manager like Plovjik would read Step 0, recognise that she had no sub-managers, count her animals, and report. A regional manager would read Step 0, recognise that she did have sub-managers, skip to Step 1, and collect their counts. The tablet handled the entire hierarchy with a single set of instructions — but only because Step 0 provided a way to stop descending.

The Self-Reference

Blortz, reading the revised tablet, noticed something unusual.

Blortz: Step 1 says "collect the count from each of your sub-managers." But each sub-manager follows the same tablet. So the tablet is telling the sub-manager to follow this very tablet, which tells the sub-sub-manager to follow this very tablet, which tells the sub-sub-sub-manager...

Glagalbagal: Yes. The tablet references itself. Each level follows the same instructions, but at a smaller scale — fewer sub-managers, fewer levels below. Eventually you reach a manager with no sub-managers at all, and Step 0 stops the process.

Blortz: And if you had forgotten Step 0?

Glagalbagal: Plovjik would have tried to collect counts from sub-managers who do not exist. She would have been stuck. Or worse — she might have interpreted the sheep as sub-managers and tried to ask them for their counts.

Blortz: The sheep would not have been helpful.

The tablet was the first of Glagalbagal's instructions that referred to itself. It worked because of two properties: each self-reference operated on a smaller piece of the problem (fewer levels of hierarchy), and there was a bottom case (Step 0) where the self-reference stopped. Without both properties, the tablet would have produced the same kind of runaway behaviour as the circular reference between the Carrying Tablet and the Overflow-Check Tablet in Part 13 — but more insidious, because a circular reference between two tablets was easy to spot, while a single tablet referencing itself looked perfectly reasonable until it ran forever.

The Right Dinosaur for the Job

One last observation. Qveshna, who was coordinating the entire operation, noticed that different levels of the hierarchy were best served by different types of dinosaurs.

The bottom-level counting — placing pebbles in baskets as animals walked by — required speed and precision. Velociraptors were ideal: fast, nimble, and able to handle pebbles deftly. But they could only carry one or two pebbles at a time, which made them useless for transporting complete arrangements between managers.

Transporting arrangements between sub-managers and regional managers required carrying entire baskets across moderate distances. Triceratopses were built for this — slow but strong, able to carry a full arrangement without dropping anything.

Coordinating at the top level — flying between distant regions to collect and deliver results — required pterodactyls.

Using a velociraptor for transport was too slow (too many trips for a few pebbles each). Using a triceratops for bottom-level counting was absurdly wasteful (a creature that could carry a hundred baskets, counting one pebble at a time). Matching the right creature to the right task in the hierarchy mattered as much as the instructions themselves.