Welcome to The Riddler. Every week, I offer up problems related to the things we hold dear around here: math, logic and probability. There are two types: Riddler Express for those of you who want something bite-sized and Riddler Classic for those of you in the slow-puzzle movement. Submit a correct answer for either, and you may get a shoutout in next week’s column. If you need a hint, or if you have a favorite puzzle collecting dust in your attic, find me on Twitter.

Riddler Express

From Frank Lynch, a speedy brain teaser:

You’re driving a car down a two-mile track. For the first mile, you drive 30 miles per hour. How fast do you have to go for the second mile in order to average 60 miles per hour for the whole track?

Submit your answer

Riddler Classic

From Max Weinreich, a purge puzzle:

A town of 1,000 households has a strange law intended to prevent wealth-hoarding. On January 1 of every year, each household robs one other household, selected at random, moving all of that house’s money into their own house. The order in which the robberies take place is also random and is determined by a lottery. (Note that if House A robs House B first, and then C robs A, the houses of A and B would each be empty and C would have acquired the resources of both A and B.)

Two questions about this fateful day:

What is the probability that a house is not robbed over the course of the day? Suppose that every house has the same amount of cash to begin with — say $100. Which position in the lottery has the most expected cash at the end of the day, and what is that amount?

Submit your answer

Solution to last week’s Riddler Express

Congratulations to 👏 Chris Riddle (!) 👏 of San Diego, winner of the previous Express puzzle!

A very specific logic underlies the grid of numbers below, and X is somewhere between 1 and 14. What, specifically, is X?

6 4 7 5 X 12 3 11 16

X is 8. Or, more illustratively, X is “eight.” The logic underlying the grid concerns the length of the spelled-out word for each number. The length of the numbers increases across each row and down each column. In the top row, for example, 6 has three letters, 4 has four letters, and 7 has five letters. Continuing that pattern in the middle row, 5 has four letters and 12 has six letters, so our answer must have five letters. We’ve already used 3 and 7. That means it’s 8.

Solution to last week’s Riddler Classic

Congratulations to ☕ Brian Hare ☕ of Raleigh, North Carolina, winner of the previous Classic puzzle and the new Caffeine King of Riddler Headquarters!

At Riddler Headquarters, the coffee pot holds one gallon of coffee, and workers fill their mugs from it in sequence. Whoever takes the last drop has to make the next pot, no ifs, ands or buts. Every worker in the office is trying to drink as much coffee as he or she can while minimizing the probability of having to refill the pot. But a worker can’t keep pouring until she sees or feels just a drop left — you’ve got to commit to a desired amount before you start pouring. Anyone stuck refilling the pot becomes so frustrated that they throw their cup to the ground in dismay, so they get no coffee that round.

After receiving all of your 1,538 submitted amounts, I simulated 1 million trips to the Riddler Headquarters coffee pot by an office full of you, our newly hired Riddler employees. In each simulated trip, a random employee stood up and decided it was time for some joe, then acted according to the office rules above and whatever condition they found the coffee pot in. In the end, the simulated employees consumed enough coffee to fill over 20 standard shipping containers.

And after this lengthy parade of strategic mug-filling, there was a virtual tie for first place! Brian Hare, who sought 0.99622 gallons each time he went to the coffee pot, successfully drank an average of 0.4182381 gallons per trip over 686 trips. Matt Van Ommeren, who sought a much more restrained 0.849 gallons, successfully drank an average of 0.4182266 gallons per trip over 609 trips. The difference between those averages is only about 0.0002 cups!

But a caffeine win is a caffeine win, no matter how small. Our victor described his thinking this way: “Go big or go home. Nobody is going to win with a low number. If most people go higher than 0.5, the pot will be refilled constantly anyway. The only reason I’m not choosing 0.99999999 is to account for the trolls that will put 0.00001.”

Many others were bunched close to the top of the leaderboard, and about 20 solvers averaged more than 0.4 gallons per trip. Indeed, most of the top finishers tried to pour themselves a lot of coffee each time they headed to the break room. A plurality of solvers submitted an amount greater than 0.99 gallons. The idea behind submitting something very, very close to 1 was that, often times, especially if others are going for big amounts, you’ll head to the break room to find a fresh, just-refilled pot. Basically, you’re hoping the person before you got unlucky.

Other common submissions were amounts near 0.5 gallons and, oddly, amounts of exactly 0.055 gallons. This smelled to me like a small but gleeful group of coffee spammers’ clever attempt to torpedo the utopian caffeine-delivery mores of the Riddler office. These small requests often spoil it for those who went for 0.9999 or the like, and by flooding the office with requests for 0.055 gallons, an accomplice could then request an amount just a tiny bit below 0.945 gallons, leaving just a drop in the pot in many cases. And indeed, there was such a Riddler saboteur! However, he miscalculated, submitting exactly 0.945, so he had to refill the pot too often. Cheaters never prosper in Riddler Nation.

As a general rule, mathematical conspiracies aside, the popular strategy of going for a lot of coffee paid off. It’s a gamble, of course. As you attempt to pour yourself greater and greater amounts, you’re balancing the increasing risk of having to refill the pot with the increasing gain of getting more hot, delicious coffee. But the gamble tended to pay off.

The tradeoff is reflected in the chart above. This outcome was also closely reflected in the theoretical simulations by solvers Cole Peterson and Daniel Eriksson. When you request a small amount, the relationship between coffee desired and coffee drunk is increasing and approximately linear. Essentially, you drink what you want and run a very low risk of emptying the pot. But once you start asking for a lot of coffee, especially for requests above 0.5 gallons, the returns tail off and the curve levels out; the increased amount is offset by the probability of getting no coffee in a given trip. The payoffs appear to peak just shy of where the greediest strategists placed their requests. You’d do well to account for some of the meager requests put in by other employees.

At least in these 1 million trials, you also did well if you were a little less greedy than 0.999999. As Brian reminded us, it’s always important to account for the trolls. (Remember, too, that this was a simulation, so there is some chance brewed in — you may have had the misfortune of having to refill the pot over and over, or get the luck of finding many fresh pots waiting for you.)

But, win or lose, remember: The best part of waking up is game theory in your cup.

Want to submit a riddle?

Email me at oliver.roeder@fivethirtyeight.com.