A thief has your bank card and one try at the PIN pad before the machine swallows the card. He types four digits. What are his chances?
You already know the ingredients: Chapter 1 counted 10,000 possible PINs, and exactly one of them opens the account. If the thief's guess is just one of those ten thousand possibilities β one ticket in a fair raffle of ten thousand β his chance is 1 in 10,000. Small. Not zero.
That move β from how many to how likely β is all this chapter adds, and it is the move that turns Chapter 1's counts into a thief's odds. Probability, in this book, is never a mysterious fog machine: it is one counting answer divided by another. But two honest subtleties live here β when you may multiply chances, and why "at least once" questions are best answered backwards β plus one physical fact that the whole book leans on: a chance is only as good as the fairness of the process behind it.
Roll a fair die. There are 6 faces, all built alike, so all six outcomes are equally likely. What is the chance of an even number? Count the favorable faces β 2, 4, 6, that's 3 β and divide by the total: \(3/6 = 1/2\). The chance is one half, said aloud as "1 in 2."
That is the whole definition, and it is only Chapter 1 wearing a new word:
When every outcome of a process is equally likely, the probability of an event is
\[ \frac{\text{the number of favorable outcomes}}{\text{the number of possible outcomes}}. \]It is always a number from 0 (no favorable outcomes β impossible) to 1 (every outcome favorable β certain). Read \(1/4\) as "1 in 4," \(1/10{,}000\) as "1 in ten thousand."
The equally-likely clause is doing real work, and Β§2.5 will stare at it. For now, the examples it earns are the symmetric ones: a fair coin, a fair die, a well-shuffled deck, a thief with no information guessing one possibility out of \(N\). In every case the probability is a ratio of two counts, and Chapter 1 supplies both.
The frame that matters for this entire book is the raffle. \(N\) tickets, one winner, one draw: the chance of holding the winner is 1 in \(N\). Every guessing game in Bitcoin is a raffle in this shape:
That last one deserves a slow look. Written as a fraction it has a 1 on top and the forty-digit number on the bottom. There is no everyday name for a chance that small, and decimal notation for it needs thirty-nine zeros after the point β so this book simply refuses to write it any other way than 1 in \(2^{132}\). When the numbers get cosmic, "1 in \(N\)" is the honest notation: it keeps the size of \(N\) in view instead of hiding it in a fog of zeros.
A probability of exactly 1 in \(N\) also has a quieter reading: it is what no information looks like. The thief who knows nothing about your PIN faces the full 10,000. Knowledge shrinks raffles β knowing the PIN isn't 0000 leaves 9,999 β and measuring how much knowledge shrinks them is where Part II is heading.
What is the chance of two heads in two flips? Count: 4 sequences, 1 favorable, so \(1/4\). Now notice the shortcut: the chance of heads is \(1/2\) per flip, and \(1/2 \times 1/2 = 1/4\). The chances multiplied β for exactly the reason the counts multiplied in Chapter 1. Each flip is its own stage, and what happens at one stage does not change what is available at the next. The coin has no memory.
If a process runs in independent stages β what happens at one stage does not influence the others β then the probability of a full sequence of outcomes is the product of the stage probabilities.
Independence is the load-bearing word. Two flips of one fair coin: independent. Two cards pulled from one deck without replacement: not independent β the first pull changes what is left for the second, exactly like Chapter 1's bookshelf. When in doubt, go back to counting; the counts never lie.
The proposition turns long shots into very long shots fast. Guessing a 4-digit PIN and then a second card's 4-digit PIN: \(1/10{,}000 \times 1/10{,}000\), one in \(10^8\) β 1 in a hundred million. Guessing a full sequence of ten coin flips: \((1/2)^{10}\), which is 1 in \(2^{10}\), or 1 in 1,024. And guessing all twelve words on the card in one try: 1 in \(2^{132}\). The exponent arithmetic from Chapter 1 β twelve words of eleven flips each β is doing the lifting; the chances inherit it.
Some questions are natural to ask and horrible to count directly. "At least one head in ten flips" β count the favorable sequences and you are counting sequences with one head, two heads, three headsβ¦ a mess of cases. Turn the question around. The opposite of "at least one head" is "all tails," and all-tails is a single sequence out of \(2^{10} = 1{,}024\):
\[ \text{chance of at least one head} = 1 - \frac{1}{1{,}024} = \frac{1{,}023}{1{,}024} \approx 0.999. \]About 999 in 1,000. The backwards count took one line.
The probability that something happens at least once is 1 minus the probability that it never happens: count the "never" case and subtract from 1.
Here is the rule earning its keep on a question that started this entire subject. Throw a die four times; what is the chance of at least one six? "Never" is four non-sixes, and each throw keeps 5 of its 6 faces, independently: \((5/6)^4 = 625/1{,}296\). So the answer is
\[ 1 - \frac{625}{1{,}296} = \frac{671}{1{,}296} \approx 0.518 \]β a touch better than half. Now the twin: throw a pair of dice twenty-four times; what is the chance of at least one double-six? A double-six is 1 of 36 pair-outcomes, so "never" is \((35/36)^{24}\), and
\[ 1 - \left(\frac{35}{36}\right)^{24} \approx 0.491 \]β a touch worse than half. Two bets that look identical in feel, on opposite sides of an even chance.
Those two bets are the actual question the Chevalier de MΓ©rΓ© β a French gambler, not a mathematician β put to Blaise Pascal in 1654. De MΓ©rΓ© had made money on the first bet and was losing it on the second, and he wanted to know why two such similar wagers behaved differently. Pascal wrote to Fermat, and their letters worked out the arithmetic of chances: counting outcomes, equally likely cases, the complement. Historians date probability theory to that correspondence. It began, literally, with a gambler asking why his edge had flipped β and the answer was counting.
Python's Fraction keeps the arithmetic exact: what prints here is what the chapter prints, no rounding fog.
Go back to the equally-likely clause, because everything above stands on it. The die gives each face \(1/6\) because the cube is symmetric; a shaved die does not. The raffle gives each ticket \(1/N\) because the tickets are mixed; a rigged drum does not. Probability is arithmetic plus a physical promise that the outcomes are equally likely, and the arithmetic cannot supply the promise.
Hold onto that when the raffle is a Bitcoin key. "1 in \(2^{132}\)" describes a thief facing twelve words chosen fairly β every phrase exactly as likely as every other. Whether real key generation keeps that promise is a physical question about where randomness comes from (Chapter 6), and the answer is sometimes no, expensively (Chapter 9). The count is Chapter 1's; the chance is this chapter's; the fairness must be earned, and earning it is most of the rest of the book.
You can now turn any count into a chance: favorable over total (Definition 2.1), "1 in \(N\)" for the raffle frame, multiplication for independent stages (Proposition 2.1), and the complement for "at least once" (Definition 2.2). What you cannot yet answer is the question a patient thief actually asks. The thief does not expect to win in one try; the thief expects to try β a thousand times, a million times β and wants to know how the tries accumulate. How many guesses until he should expect a hit? Is that expectation a promise? Chapter 3 builds the arithmetic of exactly that.
Exercise 2.1 β One try. What is the chance of guessing a 6-digit PIN in a single attempt? You should get exactly 1 in \(1{,}000{,}000\).
Exercise 2.2 β Two heads. What is the chance of two heads in two fair flips? Get it two ways β by counting the four sequences, and by multiplying stage chances β and confirm both give \(1/4\).
Exercise 2.3 β β At least one. What is the chance of at least one head in four flips? Use the complement. You should get \(15/16 = 0.9375\).
Exercise 2.4 β
β
The card's chance, in code. In Python: from fractions import Fraction as F, then F(1, 2048**12). Confirm the denominator is exactly Chapter 1's forty-digit count, 5,444,517,870,735,015,415,413,993,718,908,291,383,296.
Exercise 2.5 β
β
De MΓ©rΓ©'s pair. Compute both of de MΓ©rΓ©'s bets yourself: 1 - F(5,6)**4 and 1 - F(35,36)**24, with float(...) around each. You should get about \(0.5177\) and about \(0.4914\) β and the first bet is the better one.
Exercise 2.6 β
β
β
A thief somehow learns that your 4-digit PIN is not 0000. How many possibilities remain, and what is his one-try chance now? More generally: explain, in a sentence or two, why any solid information about a secret changes the thief's raffle β and why this makes "how much does he already know?" the question that matters.
Sketches, not model answers β enough to check your reasoning against. The computational exercises embed their expected outputs in the exercise text.
Exercise 2.6. Ruling out 0000 leaves \(10{,}000 - 1 = 9{,}999\) possibilities, all still equally likely, so the one-try chance rises from 1 in 10,000 to 1 in 9,999 β barely better, because one fact barely shrank the space. The general point is the definition itself: probability is favorable over total, and information is anything that shrinks the total. A little information moves the raffle a little; enough information β the kind Chapter 9 shows leaking out of bad randomness β collapses it. That is why the security question is never just "how big is the space" but "how much of it is he really facing."