Fiddler on the Proof

Fiddler on the Proof

Can You Fix the Random Number Generator?

I suspect that my calculator’s random number generator is malfunctioning. After it produces one number, what can I surmise regarding its behavior?

Zach Wissner-Gross's avatar
Zach Wissner-Gross
Jun 19, 2026
∙ Paid

Welcome to Fiddler on the Proof, the spiritual successor to FiveThirtyEight’s The Riddler column.

Every Friday morning, I present mathematical puzzles intended to challenge and delight you. Most can be solved with careful thought, pencil and paper, and the aid of a calculator. The “Extra Credit” is where the analysis typically gets hairy, or where you might turn to a computer for assistance.

I’ll also give a shoutout to 🎻 one lucky winner 🎻 of the previous week’s puzzle, chosen randomly from among those who submit their solution before 11:59 p.m. the Monday after puzzles are released. I’ll do my best to read through all the submissions and give additional shoutouts to creative approaches or awesome visualizations, the latter of which could receive 🎬 Best Picture Awards 🎬.

This Week’s Fiddler

I think the random number generator on my calculator might be malfunctioning. Oh no!

Under normal conditions, it should generate random numbers between 0 and 1. But my suspicion is that the calculator is “tanked,” meaning it only generates random numbers between 0 and some value 0 < a < 1. Beyond that, I have no knowledge regarding the value of a. At the moment, it’s equally likely to be any value from 0 to 1.

As an experiment, I ask the calculator to generate one random number. It produces a value of exactly 0.5. (While this is, admittedly, infinitely unlikely, let’s roll with it!)

Based on this result, what can I expect the value of a to be, on average?

Submit your answer

This Week’s Extra Credit

Frustrated with my old calculator, I toss it in the trash and buy a new one. But now I’m concerned this second calculator is also “tanked.” As before, every value of a between 0 and 1 is equally likely at first.

I ask my friend to generate one random number using this second calculator. My friend does so, and smirks. “I won’t tell you what the number is,” my friend says, “but it’s somewhere between 0 and 0.5.”

On average, what can I expect the value of a (for this second calculator) to be?

Submit your answer

Making the ⌊Rounds⌉

There’s so much more puzzling goodness out there, I’d be remiss if I didn’t share some of it here. This week, I’m sharing an old Substack note from Elliott Thornley, which I paraphrase below:

In front of you are two urns. The smaller urn contains exactly one white ball and one red ball. The larger urn contains 1 million white balls and two red balls.

You can choose one of the urns and remove exactly one ball from it at random. If the ball is white, you get $1. Two white balls are then added to the urn (the one you removed, and one additional white ball), and the game continues.

At any point, if the ball you remove is red, the game ends.

If your goal is to maximize your expected (i.e., average) earnings, which urn should you choose? And how much should you be willing to pay to play this game with that urn?

Want to Submit a Puzzle Idea?

Then do it! Your puzzle could be the highlight of everyone’s weekend. If you have a puzzle idea, shoot me an email. I love it when ideas also come with solutions, but that’s not a requirement.

Standings

I’m tracking submissions from paid subscribers and compiling a leaderboard, which I’ll reset every quarter. All correct solutions to Fiddlers and Extra Credits are worth 1 point each. Solutions should be sent prior to 11:59 p.m. the Monday after puzzles are released. At the end of each quarter, I’ll 👑 crown 👑 the finest of Fiddlers. If you think you see a mistake in the standings, kindly let me know.

Last Week’s Fiddler

Congratulations to the (randomly selected) winner from last week: 🎻 Kenny Coven 🎻 from Chagrin Falls, Ohio. I received 46 timely submissions, of which 40 were correct—good for an 87 percent solve rate.

Semicircle Island is shaped like a perfect semicircle (or semidisk, technically), with a radius of 1 mile. It doesn’t have any permanent residents, but it’s a very popular destination for surfers.

Last week, rumor had it that a big wave was headed toward the island, but no one knew which direction it was coming from. This thin, straight wall of water never changed speed or direction. It would first make contact with the island at 10 a.m. and it would last be in contact with the island at 10:10 a.m.

What was the longest possible stretch of land that was directly under the wave at 10:05 a.m.?

At either 10 a.m. or 10:10 a.m. the wave was in contact with one of the island’s two sharp corners. For the puzzle, it didn’t matter which of these times it was, so let’s say this occurred at 10 a.m. Then, at 10:10 a.m., the wave was tangent to the island’s circular coast. The key was to realize that, to have the longest possible stretch of land under the wave at 10:05 a.m., you wanted the wave to pass over the other sharp corner of the island, as illustrated below:

Let’s set the center of the circle (if we had deigned to draw its bottom half) at the origin, O = (0, 0). The wave first hit the island at point A = (1, 0) and last made contact an angle 𝜃 around the circumference at the point B = (cos(𝜃), sin(𝜃)). At 10:05 a.m., the wave passed through both point C = (-1, 0) and the midpoint between A and B, which was point D = (1/2 + cos(𝜃)/2, sin(𝜃)/2).

Now, how to compute the length of that purple chord in the above diagram?

There were several ways to attack this, one of which was to recognize that line CD had to be parallel to the blue lines representing the wave’s initial and final positions. Meanwhile, the wave was perpendicular to the direction in which it propagated, along the line OB. Thus, the requirement was that CD was perpendicular to OB at their intersection, E.

Two vectors are perpendicular when their dot product equals zero. Vector CD was (3/2 + cos(𝜃)/2, sin(𝜃)/2), while vector OB was (cos(𝜃), sin(𝜃)). Their dot product was 3/2·cos(𝜃) + cos2(𝜃)/2 + sin2(𝜃)/2, which had to equal zero. Using the trigonometric identity sin2(𝜃) + cos2(𝜃) = 1, this gave you 3/2·cos(𝜃) + 1/2 = 0, or cos(𝜃) = -1/3. Angle 𝜃 was the measure of angle AOB in the diagram above, and if its cosine was -1/3, then the cosine of supplementary angle COB was 1/3. Since OC was a radius of the unit circle, it had length 1, which meant OE had length 1/3.

By the Pythagorean theorem, CE had length √(1−(1/3)2) = 2(√2)/3. Line segment CE was half the length of the purple chord, so the longest stretch of land under the wave was 4(√2)/3, or about 1.8856 miles. (I accepted any answer between 1.88 and 1.89 miles.)

Here’s an animation from solver 🎬 Jason Shaw 🎬 showing all the possible lengths. Sure enough, the maximum is approximately 1.8856 miles.

Last Week’s Extra Credit

Congratulations to the (randomly selected) winner from last week: 🎻 Vamshi Jandhyala 🎻 from London, United Kingdom. I received 35 timely submissions, of which 34 were correct—good for a 97 percent solve rate.

Another wave was approaching the island. Yet again, no one knew which direction it was coming from. For the moment, all directions were equally likely.

On average, what was the length of the stretch of land directly under the wave halfway between when the wave first and last made contact with the island?

User's avatar

Continue reading this post for free, courtesy of Zach Wissner-Gross.

Or purchase a paid subscription.
© 2026 Zach Wissner-Gross · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture