One question about a random chord, three honest recipes, three different answers.
Is a random chord of a circle longer than a side of the inscribed triangle? Bertrand (1889) picked chords three natural ways: two random endpoints on the circle, a random point on a random radius, or a random midpoint in the disk, and got 1/3, 1/2 and 1/4. Each panel samples one recipe from its own seeded generator and rains thousands of chords into a float density grid that is tone mapped with auto exposure, so the chalk density shows where each recipe likes to put them and never saturates. Histograms of chord length fill in against the exact densities, and a shared log-scale plot shows the three running estimates settling onto three different limits. The midpoint view makes the reason plain: a chord is long exactly when its midpoint lands inside radius 1/2, and the three recipes spread midpoints differently.
Try it. Hover (or touch) a circle to pick one chord by its midpoint and see how much more or less likely each recipe makes it. Click outside the circles or press M to switch between chords and midpoints. Space pauses, the arrow keys change speed, R starts over.
Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.
Build an interactive demonstration of Bertrand's paradox with JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.
The question: pick a chord of a circle at random. How likely is it to be longer than a side of the inscribed equilateral triangle (sqrt(3) for a unit circle)?
Start simple:
- Make a canvas that fills the window and stays sharp on high-DPI screens. Draw three circles side by side, each with its inscribed triangle.
- Give each circle one sampling recipe. Random endpoints: two uniform angles on the circle. Random radius: a uniform angle, then a uniform distance d along that radius, and the chord perpendicular to it there. Random midpoint: a uniform point inside the disk (use sqrt of a uniform for the radius), and the chord with that midpoint.
- Each frame, add a few new chords to every circle. Draw long chords (length above sqrt(3)) in one color and short ones in another, and keep a running count of the fraction that are long.
- Speed up over time so thousands of chords pile up, and draw them with low opacity so the density shows.
Once that works, make it beautiful:
- Style it as a chalkboard: a dark green slate with faint smudges, chalky lines (a few slightly offset passes with a broken dash), and hand-lettered labels.
- Under each circle, add a histogram of chord lengths with the exact density drawn over it: 2 / (pi sqrt(4 - L^2)) for endpoints, L / (2 sqrt(4 - L^2)) for radius, and L / 2 for midpoint.
- Show each running estimate next to its limit: 1/3, 1/2 and 1/4.
Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as a view that plots chord midpoints instead of chords, a hover that compares how likely one chord is under each recipe, or Jaynes' argument for why the random radius answer is the natural one.