cd .. / course
Part 1 · Lesson 3/15

Meaning has directions you can do arithmetic with

If a word is a vector, then the difference between two words is a direction — and you can add and subtract those directions to travel across meaning.

⏱ ~5 min 🎚 interactive math: some

Last page you saw that nearby vectors mean similar things. Here's the surprising part: the difference between two vectors is itself meaningful. The arrow from king to man points the same way as the arrow from queen to woman — it's the "royal → commoner" direction.

So you can do arithmetic on meaning. king − man strips away "royalness" leaving the male→neutral leftover; + woman then swings it female — and you land on queen. Nothing below is looked up as an answer: the widget does the subtraction, then searches every word for the nearest one.

Heads-up: this page uses a separate little demo vocabulary (man / woman / king / queen …) with its own axes [gender, royalty, age] — not the cat / sat / it … sentence tokens from the other pages. It needs clean gender and royalty axes for the analogy to land exactly; king is not a row in the sentence table.

Poke it · the analogy calculator
A
−
B
+
C
Or try a known-good analogy
Nearest words to the result (A, B, C excluded)

TRY → Leave it on king − man + woman and read the big word: queen, cos = 1.00. Now change any dropdown, or tap a preset — every result is the arithmetic in the box run through a nearest-word search, computed on the spot. There is no lookup table of answers.

Show me the actual numbers

Each word is a 3-number vector: [gender, royalty, age], where gender is −1 male / +1 female, royalty is 1 for royals, and age is 1 for the young. The whole calculation is three subtractions and additions, done slot by slot.

king − man + woman, worked one dimension at a time:

gender: −1 − (−1) + 1 = 1
royalty: 1 − 0 + 0 = 1
age: 0 − 0 + 0 = 0

Result [1, 1, 0] — that is queen exactly (female, royal, adult), so the cosine is 1.00. Subtracting man and adding woman flipped only the gender slot; the royalty slot never moved, so we stayed royal and just changed sex.

prince − boy + girl, the same way:

gender: −1 − (−1) + 1 = 1
royalty: 1 − 0 + 0 = 1
age: 1 − 1 + 1 = 1

Result [1, 1, 1] = princess (female, royal, young). Same male→female move, but this time the "young" slot rode along untouched.

The widget then measures cosine similarity from the result to all eight words and keeps the largest — excluding A, B and C so the answer can't just be one of the inputs. Because our little vocabulary is built on clean axes, the intended analogies land exactly on a real word (cos 1.00); an off-target combo still returns the honest nearest word, just with a lower score.

Mythking − man + woman = queen is a cute coincidence someone hard-coded into a demo.
RealityIt's real vector subtraction landing next to a real word. The widget recomputes the arithmetic and searches for the nearest word every single time — change an input and the winner changes with it.
Takeaway

Differences between vectors are directions of meaning. Add and subtract them and you navigate — the "answer" is just the real word the math lands nearest to.

king − man + woman lands near queen because…
Why: the difference between two vectors is a direction of meaning. Here that direction is male→female; applying it to king keeps the royalty slot fixed and only swings gender, so you arrive at queen.