The Third Umpire · Lesson 1 — The Maths ← Course
Optional · go further

The maths — the probability underneath.

The handful of ideas from probability that sit under everything in Lesson 1 — gathered in one place.

You don't need any of this to carry on — if maths isn't your thing, skip straight to Lesson 2. But if you'd like to see the actual machinery, here are the few ideas the lesson quietly leaned on, each in plain language with its formula beside it.

They all orbit one thing: turning the model's raw scores into probabilities, then reading a decision out of them.

Start with the engine that does it — softmax. Nudge the three raw scores 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
out2.2
not out1.2
leg before0.3
→ probabilities (softmax)
out0%
not out0%
leg before0%

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 wicket has probability 0.1, surviving the ball is 0.9. 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 ball thrown up coming back down is p = 1 — certain.
In Lesson 1: the confidence number, and every bar on The Odds.
A probability distribution
Usually more than one thing could happen, so a probability distribution lists a probability for every option. 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), which for two options is simply p and 1 − p. So a distribution isn't a single guess; it's the whole picture of how the chances are shared out.
p1 + p2 + … + pn = 1
ExampleFor one delivery: out = 0.5, not out = 0.4, leg before = 0.1. Add them — 0.5 + 0.4 + 0.1 = 1.0. Nothing is left over.
In Lesson 1: out 54% + not out 46% = 100%.
Logits → softmax
Each option gets a raw score — a logit, z — any number at all, positive or negative. These aren't probabilities yet: they don't sit between 0 and 1, and they don't add to anything tidy. Softmax fixes that: it exponentiates each score so all are positive, then divides by the total so they sum to 1. The illuminating part is what actually drives the answer — only the gaps between scores matter:
pi = exp(zi) / Σj exp(zj) — softmax
exp(zi) > 0 — every score becomes positive
Σ pi = 1 — and they sum to 1
pi / pj = exp(zi − zj) — only the gap matters
ExampleTwo logits, 2 and 1. exp(2) ≈ 7.39, exp(1) ≈ 2.72, total ≈ 10.1 → 0.73 and 0.27. Their gap is 1, and sure enough 0.73 / 0.27 ≈ 2.72 = exp(1) — the gap, in numbers.
In Lesson 1: the engine behind every bar — and the demo above.
Argmax & confidence
Once you have a distribution, one simple policy is to take the option with the highest probability. “Argmax” is just the name for “which position holds the largest value”, and there's a shortcut — the winner is the same whether you read the probabilities or the raw logits: argmax pi = argmax zi. But a model usually doesn't take the top every time: it can sample from the distribution, drawing each option in proportion to its probability — which is why the same appeal can come back differently. Either way, softmax is what turns the raw scores into the odds you read off or draw from, and the top probability is the confidence (0.9 = sure, 0.4 = hesitant).
answer = argmaxi pi
confidence = maxi pi
ExampleTake those results — out = 0.73, not out = 0.27. The argmax is out (the larger), and the confidence is 0.73, the value itself.
In Lesson 1: the call is the tallest bar; confidence is its height.
A sentence is a product of probabilities
A model writes one token at a time, and each gets its own probability based on everything written so far. The ∏ symbol just means “multiply them all together”, and it unrolls into something readable — for three tokens (each wt is one token), P(w1, w2, w3) = P(w1) × P(w2 | w1) × P(w3 | w1, w2), where the bar “|” means “given what came before”. Since every factor is below 1, the longer the sentence the smaller the total — the tiny overall probability that gives The Nets its “chain of small bets”.
P(w1 … wn) = ∏t P(wt | w1 … wt−1)
Example“The ball” as two tokens: P(“the”) = 0.1 and P(“ball” | “the”) = 0.05. Multiply: 0.1 × 0.05 = 0.005. Two likely words, already a tiny number.
In Lesson 1: The Nets — “a chain of small bets”.
Log-probabilities
A logarithm is simply another way of writing a number — on a scale where multiplying turns into adding. That one trick, log(a × b) = log(a) + log(b), is the whole point. Here's the problem it solves: a real sentence multiplies together hundreds of probabilities, every one below 1, so the result becomes unimaginably small — far tinier than the smallest number a computer can store. It rounds to zero and the answer is lost; that collapse is called underflow. The fix is to add the logarithms of the probabilities instead of multiplying the probabilities themselves — the running total stays a sensible negative number the computer handles with ease. Nothing is lost: it's the very same value, written in “log form”, and you can always convert back. (A less-negative total means a more likely sentence.)
log P = Σt log P(wt | …)
ExampleOur two probabilities, 0.1 and 0.05. Multiplying: 0.1 × 0.05 = 0.005. Adding logs instead: log(0.1) + log(0.05) = −2.30 + (−3.00) = −5.30. Those aren't two different answers — they're one number in two outfits: log(0.005) is −5.30, and undoing the log, e−5.30, lands back on 0.005. Two probabilities multiply fine; five hundred would collapse to zero, while the log total just stays tidy at, say, −460.
In Lesson 1: the practical form of the chain above.

Where to take it next.

Every idea above is a doorway. If you want to keep going, these are the next words to search — each is the natural step up from what you just saw:

Cross-entropy / log losshow a model is scored on its probabilities while it learns.
Bayes' theoremupdating a probability when fresh evidence arrives.
Entropy & informationmeasuring how spread-out, or how surprising, a distribution is.
KL divergencehow far one distribution sits from another.

None of these are needed to finish the course — but each one deepens the picture of what “the umpire” is really doing under the hood. And several — probability, distributions, Bayes — become full, cricket-flavoured lessons of their own in The Scorebook, a sister course in the works.

On to Lesson 2 →
Go deeper — what this page does and doesn't cover optional

This is the output maths

Everything here is about the model's output — how raw scores become probabilities, and how a decision is read out of them. That's the part Lesson 1 actually used, and it's genuinely most of what you need to reason about an LLM's behaviour day to day.

What's deliberately left out

It does not cover how the model produces those raw scores in the first place — the network that produces them, and how it is trained. That machinery is a much deeper rabbit hole, and this course leaves it out on purpose: you can build real intuition, and real things, without it.

If you do want to go there

The search terms are: neural networks, backpropagation, the transformer architecture, and self-attention. Fair warning — that path is a course (or three) in itself.