Zipf's Law from Random Typing: Rank-Frequency Towers and Word Lengths (2D)
The same random-typing experiment in 2D: the page being typed, bars for the count at ranks 1, 2, 4, 8 ... with exact expectations, and the word-length histogram. Same text generator and numerical checks as the 3D version.
A monkey hits m letter keys and the space bar at random. Words are the letter runs between spaces, and their rank-frequency plot is a straight Zipf line with exponent alpha = ln(m/(1-q))/ln m, close to 1. Watch a Blender typewriter produce thousands of words, towers at ranks 1, 2, 4, 8 ... grow, vocabulary follow Heaps' law and word lengths follow q(1-q)^(L-1). Change keys, space probability, corpus size and the seed, and compare the exact theory with the typed text.
The same random-typing experiment in 2D: the page being typed, bars for the count at ranks 1, 2, 4, 8 ... with exact expectations, and the word-length histogram. Same text generator and numerical checks as the 3D version.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install