MATH 170 · From words to numbers · One-Hot & Embeddings

One-hot can’t say “alike” embeddings · cosine

You are the AI. Before you can compute with words you have to turn them into numbers. Here are the two classic ways — one where every word is a stranger to every other word, and one where the map itself knows that cats and dogs go together.

Each word owns one slot: a 1 in its own column, 0 everywhere else — an identity matrix. (The worksheet’s own version is the 3-word table {cats, dogs, flowers} in ℝ³ — same picture, smaller.) Tap two chips to measure a pair.
the worksheet’s 5-word sentence → 5 one-hot rows
Try: check three pairs in one-hot world, then flip worlds and drag lion into the flower patch — watch cos(lion, cats) fall.