Problem solved in full
-
The target mismatch gap of 0.453 over 180 words 7 steps
Classic mode, 180 words, seed
spock, target entropy 6.2. The panel measures 5.747 bits per word and reports a target mismatch of 0.453. Work out how much of that gap the generator could ever close, and how much of it exists only because you counted 180 words rather than a million.-
Classic mode picks each word independently and uniformly from the distinct words of the source corpus. That corpus is 69 words long and 63 of them are different, so every draw is one chance in 63, which the trace prints as 1.6%.
-
A uniform draw is the most unpredictable draw there is over a fixed alphabet, so log2 63 is a ceiling, not an average. The target of 6.2 sits above it. That much of the mismatch is a fact about the corpus and no seed, no re-roll and no word count can touch it.
-
Now tally the passage the generator actually printed: 12 words occur once, 13 twice, 16 three times, 10 four times, 7 five times, 2 six times, and 1 word occurs 7 times. Two sums confirm the tally is complete β 61 distinct words, 180 tokens β and the first of them is the panel's second figure.
-
Measured entropy is the plug-in estimate: take the observed frequencies and treat them as if they were the probabilities. Grouping words by how often they occurred collapses a 61-term sum into a 7-term one, because two words seen 3 times contribute identically.
-
The words seen once contribute nothing at all, since 1 Γ log2 1 = 0, so only 6 terms survive.
-
Subtract, and it lands on the panel to the last printed digit.
-
The remaining 0.230 bits sit between the measurement and the ceiling, and they are an artefact of counting: 2 of the 63 words never came up, and a plug-in estimate reads a ragged histogram as though it were the truth, which understates the entropy every time. MillerβMadow corrects that to first order using the number of word types actually observed.
Answer
5.747 bits per word, and the printed 0.453 is two unrelated things added together. 0.223 of it is a wall β the corpus supplies 63 words, log2 63 = 5.9773, and reaching 6.2 would need 26.2 = 73.5, so a vocabulary of at least 74 distinct words. The other 0.230 is not a property of the text but of the sample size, and the correction recovers it: 5.988 against a true ceiling of 5.9773, overshooting by 0.010. Even the sign of that overshoot is derivable β the generator builds 6 candidate passages and keeps whichever measures closest to the target, and since every candidate falls short of 6.2, keeping the closest means keeping the most uniform. The bias term falls as 1/N: at 1,800 words it is 0.025 bits, so a longer passage quietly fixes half the mismatch and leaves the other half exactly where it was.
-
References (2)
- The chain the generator runs, and the entropy it reports: C. E. Shannon, "A Mathematical Theory of Communication." The Bell System Technical Journal 27(3), 379β423, 1948.
- The word-frequency shape the Zipf readout checks against: G. K. Zipf, Human Behavior and the Principle of Least Effort. Addison-Wesley, 1949.