How does a computer find one thing in a billion?
A computer can find your one message in a pile of a billion, almost instantly. It does not look through them all. It uses a trick you already know from a guessing game.
A computer can find your one message in a pile of a billion, almost instantly. It does not look through them all. It uses a trick you already know from a guessing game.
Picture a giant pile of a billion notes, and somewhere in it is the one with your name. To find it, you could read them one at a time. But a billion notes, one every second, would take you thirty years. A computer finds it before you can blink. How?
The high low guessing game
You have played this game. I am thinking of a number between one and a hundred. You guess fifty. Too high. You guess twenty five. Too low. Each guess, I tell you higher or lower, and each guess throws away half the numbers still left. From a hundred, it takes only about seven guesses to corner any number. The secret is that every guess cuts the pile in half.
The same trick, on a billion
A computer keeps its notes in order, sorted, like names in a phone book. To find one, it opens to the middle. Is your name before or after this page? Throw away the half it cannot be in. Open the middle of what is left. Again. Again. Each step throws away half. From a billion notes, cutting in half each time, it finds your one note in about thirty steps. Thirty, not a billion. That sorted shortcut has a name, an index, and it is the quiet reason a computer can find anything the instant you ask.
And here is the part worth keeping. The computer is not faster than you because it reads quicker. For this, it barely reads at all. It is faster because it throws away more. The whole art of handling huge piles of information is finding clever ways to ignore almost all of it.
It is not faster because it reads quicker. It is faster because it throws away more.
Why grown ups care
This is the difference between a search that takes a moment and one that takes a month. When an app finds your photo, your message, your song among billions in an eye blink, it is almost always this same halving trick underneath, dressed up in cleverer clothes. Keep things in order, and you can find any one of them by throwing the rest away.