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-size and Riddler Classic for those of you in the slow-puzzle movement. Submit a correct answer for either,^{1} and you may get a shoutout in next week’s column. If you need a hint or have a favorite puzzle collecting dust in your attic, find me on Twitter.

## Riddler Express

Take aim in this problem of pinpoint perfection:

In competitive darts, a common game is called 501. Facing a standard dartboard, a player starts with 501 points and subtracts the score of each throw. He or she must finish with exactly zero points. (Also, per the rules, the final dart must land in either the bullseye or the outer, doubled segments.)

Finishing a game in the minimum number of throws is a rare feat, akin to a perfect 300 game in bowling. What is the minimum number of throws? How many different ways are there to do it?

## Riddler Classic

From Mahalingam Vaidhyanathan, a probabilistic pub game:

You are throwing darts at a dartboard that has a radius of 1 foot. Due to a gift of miraculous marksmanship, your darts always fall on the board and never outside. (Darts *can* land on the very edge of the circular board, and if they do they’re considered as landing inside the scoring area.) Furthermore, your chances of hitting any area on the board are exactly proportional to the area of the patch — your darts land according to a uniform probability distribution.

You keep throwing darts until your *n*th dart hits a location that is less than 1 foot from some other dart. You are then “out,” and n-1 is your final score. Here are three questions of increasing difficulty about this game:

- What is the maximum possible score?
- What is the probability of getting a score greater than 1 (i.e., that the second dart falls more than 1 foot away from the first)?
- What is the expected value of your score?

## Solution to last week’s Riddler Express

Congratulations to 👏 Josh Novack 👏 of New York City, winner of last week’s Riddler Express!

Last week, you were shown the cube below and asked to find the coordinates of the endpoints, ep1 and ep2, of the shortest segment that bridged the cube’s two diagonals.^{2}

Those endpoints’ coordinates are **(0,½,½) and (⅓,⅔,⅓).** The segment between them is \(1/\sqrt{6}\approx 0.41\) units long.

There are at least a couple of ways to figure out those coordinates and solve the problem. The first is with a little calculus — the approach taken by our winner, Josh. The first coordinate, ep1, lies on the line connecting (0,0,0) and (0,1,1), so let’s call it \((0,y,y)\). The second coordinate, ep2, lies on the line connecting (0,1,0) and (1,0,1), so let’s call it \((x,1-x,x)\). The distance between these two points is given by a distance formula, where we take the square root of the sum of the squared difference between these coordinates:^{3}

\begin{equation*}D = \sqrt{x^2 + (1-x – y)^2 + (x-y)^2} = \sqrt{3x^2 – 2x + 2y^2 – 2y + 1}\end{equation*}

Then, using calculus (taking derivatives and setting them equal to zero), we can find the minimum of this distance. Sure enough, the minimized distance is \(1/\sqrt{6}\) and the coordinates are (0,½,½) and (⅓,⅔,⅓).

However, the always-clever Hector Pefo observed that we don’t even need to crack our calculus textbooks, and we can solve the problem using only what we know about triangles:

## Solution to last week’s Riddler Classic

Congratulations to 👏 Gary Gerken 👏 of Littleton, Colorado, winner of last week’s Riddler Classic!

Last week you faced the following situation: A safe has three locks, each of which is unlocked by a card, like a hotel room door. Each lock (call them 1, 2 and 3) can be opened using one of three key cards (A, B or C). To open the safe, each of the cards must be inserted into a lock slot and then someone must press a button labeled “Attempt To Open.” The locks function independently. If the correct key card is inserted into a lock when the button is pressed, that lock will change state — going from locked to unlocked or unlocked to locked. If an incorrect key card is inserted in a lock when the attempt button is pressed, nothing happens — that lock will either remain locked or remain unlocked. The safe will open when all three locks are unlocked. Other than the safe opening, there is no way to know whether one, two or all three of the locks are locked. Your job as master safecracker is to open the locked safe as efficiently as possible. What is the minimum number of button-press attempts that will guarantee that the safe opens, and what sequence of attempts should you use?

You’ll need at least **13 attempts** to guarantee cracking the safe. Solver Igor Kopylov explained how to get there:

First note that, depending on where you insert the three cards, each opening attempt will perform one of five operations on the safe:

- Do nothing.
- Flip the first lock.
- Flip the second lock.
- Flip the third lock.
- Flip all the locks.

Since there are three keys, there are six different sequences in which they can be put in the safe (3×2×1), and each order leads to one of the five operations above.

The three locks start out in one of eight states, since each lock could be either locked or unlocked at the beginning (2×2×2). Because we don’t know how the locks are arranged at the start, the only way to *guarantee* opening the safe is to move through every possible state. This means we can’t possibly do better than eight attempts if we want to be sure that it’ll open before we’re done.

But just because the minimum is eight attempts doesn’t mean it’s possible in eight attempts. Off the top of my head, I could come up with a 17-attempt strategy that worked. That seemed low enough that I could write a program to try all shorter strategies. It turns out there are no winning strategies with fewer than 13 attempts. For 13, this strategy of card orders does the trick:

ABC

ABC

BCA

CAB

ABC

BCA

ABC

ACB

BAC

ACB

CBA

BAC

ACB

## Want to submit a riddle?

Email me at oliver.roeder@fivethirtyeight.com.