The Improviser · Lesson 1 — The Maths · Part 1 ← Course
Optional · go further

The maths — from scores to odds.

Part 1 of 2. The two foundations — a probability and a distribution — plus the softmax engine that turns the model’s raw scores into odds.

You don't need any of this to carry on — if maths isn't your thing, skip ahead with nothing lost. But if you want to see the actual machinery, here are the few mathematical ideas the lesson quietly leaned on, each in plain language with the formula beside it.

They all serve one job: turning the model's raw scores into probabilities, and reading the next note out of them.

Start with the engine that does it — softmax. Nudge the three raw scores for three candidate notes and watch them become probabilities that always add up to 100%.

Drag the raw scores. Softmax turns them into probabilities that sum to 100%.
raw scores (logits) — z
note C2.4
note E1.0
note G0.4
→ probabilities (softmax)
C0%
E0%
G0%

The formulas, in one place.

Each is written the way you'd meet it in a textbook, with a plain-language line above and where it turned up in this lesson below.

Probability
A probability is just a number measuring how likely something is, from 0 — it never happens — up to 1, the same as 100% and meaning certain. Halfway, at 0.5, it's as likely as not, like a coin landing heads. The handy trick is that every probability has a partner — the chance it doesn't happen — and the two always add to 1: P(not A) = 1 − P(A). So if a phrase resolving home has probability 0.78, not resolving is 0.22. Every other idea on this page is built from these simple numbers.
0 ≤ p ≤ 1
ExampleA fair coin is p = 0.5 for heads. Rolling a six on a die is p = 1/6 ≈ 0.17. A struck string eventually falling silent is p = 1 — certain.
In Lesson 1: the confidence number, and every bar on The Odds.
A probability distribution
Usually more than one note could come next, so a probability distribution lists a probability for every candidate. Because something must happen, they always add to exactly 1 (100%) — and that constraint is the key. It means you never need the last number: it's whatever is left over, plast = 1 − (sum of the rest). So a distribution isn't a single guess; it's the whole picture of how the odds are shared across the notes.
p1 + p2 + … + pn = 1
ExampleFor one step: C = 0.5, E = 0.3, G = 0.2. Add them — 0.5 + 0.3 + 0.2 = 1.0. Nothing is left over.
In Lesson 1: the six bars on The Odds, always summing to 100%.

That's the foundation.

A probability is a number from 0 to 1; a distribution is a full set of them that sums to 1; and softmax is the engine that turns the model's raw scores into that set. Part 2 is the why under that demo: why the model works in raw scores (logits), why softmax is the right way to turn them into odds, and how it commits to a single note — motivation first, then worked through.

Next: the mechanics →