Welcome to The Riddler. Every week, I offer up problems related to the things we hold dear around here: math, logic and probability. Two puzzles are presented each week: the Riddler Express for those of you who want something bite-size and the 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

From Anna Engelsone comes a riddle about a historic chess battle:

The infamous 1984 World Chess Championship match between the reigning world champion Anatoly Karpov and 21-year-old Garry Kasparov was supposed to have been played until either player had won six games. Instead, it went on for 48 games: Karpov won five, Kasparov won 3, and the other 40 games each ended in a draw. Alas, the match was controversially terminated without a winner.

We can deduce from the games Karpov and Kasparov played that, independently of other games, Karpov’s chances of winning each game were 5/48, Kasparov’s chances were 3/48, and the chances of a draw were 40/48. Had the match been allowed to continue indefinitely, what would have been Kasparov’s chances of eventually winning the match?

## Riddler Classic

From Steve Abney comes a particularly prismatic puzzle:

Suppose I have a rectangle whose side lengths are each a whole number, and whose area (in square units) is the same as its perimeter (in units of length). What are the possible dimensions for this rectangle?

Alas, that’s not the riddle — that’s just the appetizer. The rectangle could be 4 by 4 or 3 by 6. You can check both of these: 4 · 4 = 16 and 4 + 4 + 4 + 4 = 16, while 3 · 6 = 18 and 3 + 6 + 3 + 6 = 18. These are the *only* two whole number dimensions the rectangle could have. (One way to see this is to call the rectangle’s length *a* and its width *b*. You’re looking for whole number solutions to the equation *ab* = 2*a *+ 2*b*.)

On to the main course! Instead of rectangles, let’s give rectangular prisms a try. What whole number dimensions can rectangular prisms have so that their volume (in cubic units) is the same as their surface area (in square units)?

To get you started, Steve notes that 6 by 6 by 6 is one such solution. How many others can you find?

## Solution to last week’s Riddler Express

Congratulations to 👏 Stefan G. Herlitz 👏 of Brookline, Massachusetts, winner of last week’s Riddler Express.

Back in 2015, the droid BB-8 narrowly escaped the forces of the First Order on the planet Jakku, and required help. Fortunately, there was exactly one person, Rey, on the planet who can help the droid, but they’ve never met and BB-8 had no idea where Rey was located.

(All of those characters may be fighting to control their own fate, but they’re still owned by Disney, just like FiveThirtyEight is.)

Even if BB-8 *did* know where Rey was, what was the probability that BB-8 could reach her within 24 hours? You were asked to assume that Jakku had a radius of 4,000 miles and that BB-8 rolls along at a speed of 3 miles per hour.

A popular (wrong?) answer was that BB-8 had a 100 percent chance of finding Rey. Something to do with some type of force drawing them together, or something.

Sticking to mathematics, solver Alissa Friedman took the direct approach of comparing the surface area of the entire planet to the area BB-8 could access within a 24-hour period. Since a sphere of radius *R* has a surface area of 4𝜋*R*^{2}, that means the surface area of Jakku was 64,000,000𝜋 square miles. BB-8, meanwhile, could reach a circular region whose radius was 72 miles (i.e., 3 miles per hour times 24 hours). Using the formula for the area of a circle (𝜋*R*^{2}), the area of the circular region BB-8 could have accessed within 24 hours was 5,184𝜋 square miles.

That is … not that much of the planet, which is why it’s so hard for BB-8 to find Rey. The probability that Rey’s hut was located within BB-8’s circle is then the ratio of these two areas: 5,184𝜋 divided by 64,000,000𝜋, which equals 0.000081, or **0.0081 percent**. In other words, the odds of BB-8 finding the one person who could help him were approximately 12,000 to 1. In the words of another famous droid, C-3PO, BB-8 would have been better off navigating an asteroid field.

As Alissa noted, this approach ignores the (negligible) curvature of Jakku across the circular region BB-8 can reach within 24 hours. Some solvers, like Matt Manka, took the extra step of accounting for this curvature, finding that BB-8’s chances of finding Rey are closer to 0.0080998 percent. Even bleaker.

Anyway, I’m just glad BB-8 and Rey found each other via this force or whatever.

## Solution to last week’s Riddler Classic

Congratulations to 👏 Dave Hutcheon 👏 of Vancouver, Canada, winner of last week’s Riddler Classic.

Last week, you had a playlist with exactly 100 tracks, numbered 1 to 100. To go to another track, there were two buttons you could press: (1) “Next,” which took you to the next track in the list or back to song 1 if you were currently on track 100, and (2) “Random,” which took you to a track chosen uniformly from among the 100 tracks. Pressing “Random” could restart the track you were already listening to — this would happen 1 percent of the time you pressed the “Random” button.

Your goal was to get to your favorite song (on track 42, of course) with as few button presses as possible. What should your general strategy have been? Assuming you started on a random track, what was the average number of button presses you would have needed to make to reach your favorite song?

Solver Hector Pefo correctly reasoned that the optimal approach would be to press the Next button when you’re only a few tracks away from track 42 and to press the Random button when you’re far away from track 42 (hey, it couldn’t hurt!). The challenge was to find *where* this tradeoff between Next and Random occurs.

Suppose your best strategy is to hit Next when you’re *k* or fewer tracks away from track 42 and to hit Random otherwise. And let’s further suppose that if we start on a random track, the average number of button presses using this strategy is *B*. Our plan is to play out this strategy, determine how *N* depends on *k* and then select the *k* that minimizes *B* — all so that we can reach track 42 as quickly as possible, on average.

First off, our random starting point might already be within *k* of 42, which would be fantastic! For these *k*+1 tracks (we’re adding one because of the possibility of starting on track 42 itself), the average distance from track 42 will be *k*/2. For the remaining 100−(*k*+1), or 99−*k*, tracks, we’ll press the Random button and once again find ourselves in a situation where the average number of *remaining *button presses — after the one we just made — is *B*. Putting these two scenarios together, we have our equation for *B*:

*B* = (*k*+1)/100 · *k*/2 + (99−*k*)/100 · (*B*+1)

Notice this equation has a *B* on both sides. With a little algebraic manipulation, we can find an expression for *B* in terms of *k*:

*B* = *k*/2 + 100/(*k*+1) − 1

Great! Now it’s just a matter of finding which value of *k* minimizes *B*. And Riddler Nation was up to the task. Quoc Tran generated a graph of how *B* depends on *k*, and sure enough, there’s a minimum around *k* = 13.14. Using calculus, Hector found the exact minimum occurs when k = 10√2 − 1.

But wait a second — *k* represents the number of tracks away from 42 beyond which you’d start pressing the Random button. In other words, it has to be a whole number, not 13.14. The optimal value of *k* is, in fact, 13 (very close to 13.14). So that answers the first part of the riddle: Your best strategy is to press the Next button whenever you’re on tracks 29 through 41 and to press the Random button on tracks 1 through 28 and 43 through 100. On track 42, just kick back, relax and enjoy the music.

As for the average number of button presses you’d have to make, which was *B* in our equations above, we can find that by plugging in the value of 13 for *k*. It turns out that *B* is 177/14, or about **12.64** button presses on average.

Solver Hernando Cortina investigated this answer further and graphed the average number of times you’d press the Next and Random buttons, depending on the track you started on:

That’s a surprisingly efficient result. If you only pressed the Next button, you’d have to make about 50 presses on average; if you pressed only the Random button, you’d have to make about 100 presses on average. Yikes! But with this hybrid strategy, you can bring the average all the way down to 12.64. And who says solving the Riddler doesn’t prepare you for a career as a DJ?

## Want more riddles?

Well, aren’t you lucky? There’s a whole book full of the best puzzles from this column and some never-before-seen head-scratchers. It’s called “The Riddler,” and it’s in stores now!

## Want to submit a riddle?

Email Zach Wissner-Gross at riddlercolumn@gmail.com.