Part I · Chapter 3

Counting by Doubling

A single lamp can only show two states: dark or lit. Yet place a handful of lamps side by side, and their patterns multiply fast enough to count, spell, and even paint pictures.

Set one small lamp on your windowsill. How many different messages can it hold at a single moment? Just two: dark, or lit. That is handy for a yes-or-no question, but not much else.

Now place a second lamp right beside the first. Suddenly, every old pattern can appear in two new ways: with the new lamp dark, or with the new lamp lit. Your two patterns just doubled into four: both dark, right lit, left lit, or both lit.

Add a third lamp. Every one of those four patterns can now appear with the third lamp dark, or with the third lamp lit. Four doubles into eight. Add a fourth lamp, and eight doubles into sixteen. Add a fifth, and you have thirty-two—already more than enough patterns to give every letter of the English alphabet its own glowing signature.

The Doubling Rule

Each new lamp you add does not merely add one more possibility—it doubles every pattern you already had. A tiny row of lamps holds a surprisingly vast world of choices.

Counting With Doubling Piles of Dots

That exact same doubling rhythm gives us a remarkably tidy way to count. Imagine placing a small tray of dots beneath each lamp. The rightmost lamp guards a single dot (1). The lamp to its left guards twice as many (2). The next guards twice that (4), then 8, then 16, then 32.

To represent any number, you simply switch on the lamps whose dot trays add up to your total. Want 5? Light the 4-dot lamp and the 1-dot lamp. Want 11? Light 8, 2, and 1. Remarkably, every single count from zero up to the maximum has one—and only one—matching lamp pattern.

Try it below. Add or remove lamps to watch the total number of patterns double each time, click any lamp to toggle its dots, or press Count Up +1 to watch the lamps count automatically.

Interactive Lab 1 The Doubling Lamp Row

Click lamps to light their dot groups, or add more lamps to watch the possible patterns double at every step.

Current Count (Lit Dots) 0
Possible Patterns 8
With 3 lamps, you have 8 possible patterns (counting from 0 up to 7). Try clicking + Add Lamp to watch it double!
Quiet footnote: Each single on-or-off lamp is what computer scientists call a bit (short for “binary digit”), and counting with doubling dot-groups is the binary number system. Group eight lamps together, and you have a byte—which doubles all the way to 256 patterns.

Stacking Rows to Paint a Picture

Once you see that a row of lamps can hold any pattern, a breathtaking possibility opens up. Those lit and dark lamps do not have to represent counts at all. If we agree that pattern 1 means A, pattern 2 means B, and pattern 3 means C, a row of lamps can store a word.

Better yet, what happens if you stack several rows of lamps one right underneath another, like a glowing pegboard? Let every lit lamp stand for a drop of bright light, and every dark lamp stand for empty background. Suddenly, a neat stack of simple on-or-off rows transforms into a picture!

Paint your own tiny picture below by clicking squares in the grid—or try one of the presets. Look to the right of every row: you will see the exact six-lamp pattern that stores that slice of the image.

Interactive Lab 2 Painting With Lamps

Click squares to paint a 6×6 picture and watch each row turn into a clean 6-lamp pattern beside it.

Lit Squares: 0 / 36
Every picture on a phone or computer screen uses this exact trick—just with millions of microscopic colored lamps arranged in neat rows.
Quiet footnote: Each tiny glowing square in a picture grid is called a pixel (short for “picture element”), and storing a whole image as a stack of on-and-off rows is called a bitmap.

Look how far we have come in just three chapters. Starting from a single flashlight blinking in the dark, we built switches that make decisions and rows of lamps that can represent numbers, letters, and pictures. Yet there is one glaring flaw with every circuit we have built so far: the instant you let go of a switch, the pattern vanishes! In Part II, we will teach a circuit how to hold onto a memory—even after your finger walks away.

What You Just Built