the second hundred · metaphor 187

The gap, in
smallest changes.

How far apart are two drafts of a person — who he was and who he'd been, the plan you wrote in January and the one you're living now? Not by how different they look at a glance, but by the fewest real changes it would take to turn one into the other.

We feel these distances all the time without a way to name them. Two versions of a self, two drafts of a letter, the you before a hard year and the you after. Sometimes almost everything is the same and one small thing moved; sometimes the words are similar but the whole meaning was rebuilt. "Different" is too blunt a word. What you want is a count: the minimum number of single, honest edits between here and there.

There is exactly such a count, and it is beautiful. Line the two drafts up and ask: what is the shortest list of one-at-a-time changes — add a thing, drop a thing, swap one thing for another — that carries the first draft into the second? That number is the edit distance, and a small grid finds it, considering every possible alignment at once and keeping only the cheapest.

edit distance
similarity
kept
swapped
added
dropped
The cheapest path from draft one to draft two
kept · unchanged swapped · one for another added dropped
The grid that finds it · every cell is the cheapest way to reach that point
Try a pair
Type in either box and watch the distance, the path, and the grid redraw on every keystroke. The highlighted diagonal through the grid is the cheapest story of change — the green steps are what survived, the coloured ones are what it cost to become the other.

The idea

Three moves, and the fewest of them.

Fix the vocabulary of change to the smallest honest units: you may insert one item, delete one item, or substitute one item for another. Everything else is just a sequence of these. The edit distance between two drafts is the length of the shortest such sequence — the minimum total moves to turn the first into the second. Leaving an item untouched is free; that is a match, and matches are the thread of what survived.

Finding that minimum sounds hard, because the number of ways to line two drafts up is astronomical — it grows exponentially with their length. You could never check them all. But you don't have to. The distance obeys a simple rule: to align the first i items of one with the first j of the other, you only need the best alignments of slightly shorter prefixes, plus one more move. So you fill a grid, cell by cell, each cell recording the cheapest way to reach that corner. The bottom-right cell is the answer, computed in a flash.

The grid does more than count. Trace backward from the final cell, always stepping to the neighbour that fed it, and you recover the edit path itself: the actual list of keeps, swaps, adds, and drops that turns one draft into the other most cheaply. The number tells you how far apart the drafts are; the path tells you the smallest true story of how one became the other.

What to try

Type. Watch the distance breathe.

Everything recomputes on every keystroke from the real grid — nothing is stored. Start editing draft two one character at a time and watch the distance tick up and down. Add a letter and the "added" tally rises; change one and it becomes a swap, worth exactly one, no matter how loud that change feels. Notice that a swap costs the same as an add-plus-drop would cost two — so the grid quietly prefers to call a change a single substitution wherever it can.

Then read the two views together. The path spells the change out in order: the long runs of green are what stayed the same — the continuous spine of identity between the drafts — and the coloured breaks are precisely what it cost to become the other. In the grid, that same path is the highlighted diagonal staircase; every step down-and-right that lands on a match is free, and every step that costs marks a real edit. The presets range from the textbook kitten → sitting to two drafts of a self.

The mapping

How far is this self from that one.

The metaphor measures any two versions of a thing that changes in small steps. Two drafts of a self: the person before the diagnosis and after, the you at twenty and at forty. The distance is not how unrecognisable you feel — it is the fewest real changes between the two, and the matches are what you carried through unbroken. Two versions of a plan: what you intended and what you're doing; the edit path names exactly what got added, dropped, and swapped along the way. Two tellings of the same story: how much was actually revised, versus how much just moved.

And the honest gift of the grid is the alignment. It does not only say "far" or "near"; it lays the two drafts side by side and shows you which parts are the same part, held across the change, and which parts are the price of it. That is a real correspondence, not a metaphor's flourish: the continuous run of matches is a genuine claim about what stayed constant while everything around it moved. To measure the distance between two selves is, unavoidably, to discover the thread that survived the edit — the part of you that both drafts still share.

Read as life lessons

Three things the grid knows.

01

Distance is smallest-change, not appearance

Two drafts can look wildly different and sit one edit apart, or look alike and be a rebuild. The honest measure of change is the fewest real moves between them — not how strange the new version feels.

02

The matches are the identity

Every cheapest path is mostly matches — the unchanged spine carried from one draft to the next. Measuring how far you've come always reveals the thread that survived the coming.

03

Revise, don't replace

A substitution costs one; deleting and re-adding costs two. The grid always prefers to revise in place over tearing down and rebuilding — cheaper change keeps more of what was already there.

In the wild

Where smallest-change is counted.

SPELLING & SEARCH

"Did you mean…?" ranks candidates by edit distance to what you typed. Autocorrect, fuzzy search, and record matching all ask which known word is the fewest keystrokes away.

BIOLOGY

Sequence alignment scores how far two strands of DNA or protein have drifted apart in insertions, deletions, and substitutions — the same grid, reconstructing evolutionary change.

VERSIONS & DIFFS

Every diff, merge, and track-changes view is an edit script: the minimal set of adds and drops that carries one version of a document into the next.

The mapping, exactly

Mathematics ↔ life.

MathematicsLife
the two stringsTwo drafts of a self, a plan, or a text — who you were and who you are.
one edit (ins / del / sub)A single smallest change: one thing added, one dropped, one swapped for another.
edit distanceHow far apart the two drafts really are, counted in fewest honest changes.
the DP gridWeighing every possible alignment at once and keeping only the cheapest route.
the backtrace pathThe smallest true story of change — the actual list of keeps, swaps, adds, and drops.
the run of matchesThe thread of identity: what survived unchanged from one draft into the other.

The honest model

What's really under the hood.

The panel runs the Levenshtein recurrence in full. It builds a grid D where D[i][j] is the edit distance between the first i characters of draft one and the first j of draft two. The borders are seeded with D[i][0]=i and D[0][j]=j — the cost of building from nothing — and every inner cell is min of three neighbours: delete (D[i−1][j]+1), insert (D[i][j−1]+1), or match/substitute (D[i−1][j−1] + 0 or 1).

The number in the bottom-right corner is the exact edit distance — you can read it straight off the grid on screen. The coloured staircase is a genuine backtrace: starting there, it steps to whichever neighbour actually produced each value, recording a match, substitution, insertion, or deletion at each move, then reverses the list to spell the path in order. Every chip — kept, swapped, added, dropped — is just a tally of that real path, and it all recomputes from scratch each time you type a character.

Where the metaphor tears

Three honest failures.

Every change costs one — and meaning doesn't work that way.

Edit distance charges the same for every single move, but a life doesn't. One word can invert a sentence; a hundred cosmetic edits can leave it saying the same thing. The cheapest edit path is a count of keystrokes, not of significance — it will happily rate a shattering one-character change as "distance 1" and a harmless rewrite as "distance 20." When the units of change carry different weight, the flat count is the wrong measure of how far someone has travelled.

The number is unique; the story usually isn't.

There is one edit distance, but often many different paths achieve it — several equally-cheap ways to align the same two drafts. The panel shows one of them, and a single choice can narrate a change that isn't the one that actually happened. The math hands you a distance with confidence and an alignment with none; the true history of how one draft became the other is not something the grid can recover.

A self is not a string.

The whole method assumes two fixed sequences with two stable endpoints. But "who he had been" is not a frozen draft — it is a memory, re-remembered and quietly rewritten every time you reach for it. Distance presumes both ends hold still while you measure between them. A person offers neither a settled start nor a settled finish, and the tape keeps moving as you try to read it.