Skip to main content
ABC News
Are You A Master Safecracker?

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

From Pierre Bierre, think inside the box:

Given the cube shown below,2 with its two black diagonals, your job is to locate the shortest line segment — shown in orange — that bridges the gap between the diagonals. Solve for the coordinates of its two endpoints, ep1 and ep2.

Submit your answer

Riddler Classic

From Jason Weisman, commit grand larceny with math:

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) and 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?

Submit your answer

We had a special supersized 100th edition of the Riddler last time, so here are the winners of and solutions to those four puzzles:

Solution to last week’s Riddle 1

Congratulations to рџ‘Џ Joe Kelley рџ‘Џ of Mountain View, California, winner of Riddler 1!

Two weeks ago, after years of hard work as a devoted tower guard, you were knighted and set to become a member of a brand-new group dubbed the League of Interesting and Noble Knights, or LINK. Upon coming to the first meeting, you and the other five members were seated at a round table. There, your boss, King Scott, gave a grand introduction in which he welcomed you all to LINK. The king also outlined a greeting ceremony that must take place at the beginning of every LINK meeting. The ceremony concludes when every member of LINK has met every other member with a handshake. During each round of handshakes, every member of LINK must be shaking one and only one hand. Arms cannot cross during the handshake ceremony as it is in violation of the Universal Law of Respect. Between rounds of shaking, the seats can be rearranged. After this first meeting, King Scott approached you and asked you to answer the following questions: What is the minimum number of seating arrangements necessary to complete the ceremony for six knights? Eight knights? N knights?

For six and eight knights, at least three seating arrangements are necessary. For a generic number, N, of knights, at least \(\lceil \log_2 N\rceil\) arrangements are necessary — that is, the base-two logarithm of N, rounded up to the nearest integer. (Note that N must be even for this ceremony to take place, because everyone needs a hand to shake.)

The simplest way to think about the solution is to picture that, in every arrangement, the knights are divided into two groups. If I reach across the table to shake someone’s hand, no one to my left can shake hands with anyone to my right, and vice versa, because they’ll be crossing arms. Therefore, knights in one group can only shake hands with knights in the other group. For example, as solver Tim Black illustrated, the knights could be divided into a blue group and a yellow group. In the arrangement you see below,3 the group can complete three handshakes before the seating would have to be scrambled, since those in one color group can only shake hands with those in the other color group.

Because the most efficient solution is to divide the group in two, the best we can do is cut the number of people who haven’t shaken hands in half (rounding down) with every arrangement. If I’m a knight at a table with six knights total, I need to shake five hands. After the first arrangement, in which I shook hands with three knights, I have two hands left to shake. After the second arrangement, only one hand left to shake, and after the third, zero — I’m done.

Let’s add some more people. If I’m one knight of eight, I need to shake seven hands. After the first arrangement it’s three, then one, then zero — I’m done.

That’s where the base-two logarithm comes in. Essentially, if we reverse our halved-every-arrangement process, the logarithm tells us how many times we need to double (1, 2, 4, 8, 16, etc.) to get to the number of knights that happen to be sitting around our particular table. For example, \(\log_2 8=3\), hence our required three arrangements. If you want a little more detail, Black also provided an excellent discussion of the math behind this problem.

Solution to last week’s Riddle 2

Congratulations to рџ‘Џ Amy Teegarden рџ‘Џ of Salem, Oregon, winner of Riddle 2!

In the series finale of “The Office,” Kevin’s replacement, Dakota, discovered a mysterious symbol scribbled throughout Kevin’s accounting work. Confused, Dakota confronted her boss, Oscar, who explained that the symbol is a “keleven,” a number Kevin created to help him balance his accounts. In Kevin’s number system, the digit “keleven,” which is an integer that lies between two other single-digit integers, is inserted somewhere along the number line. Other than this insertion, all other digits remain in the usual order. You found the following calculations in Kevin’s notes:

853 + 520 = 1473

41×26 = 976

Dakota hired you to figure out where keleven lies in Kevin’s number system. Where did it belong?

Keleven belongs between 4 and 5. Solver Richard Guidry explained how he arrived at that solution:

Adding another digit to the number line would put our number system in base-11. A number system’s base tells you how many single-digit numbers it uses. Binary, or base-2, uses only two single-digit numbers: 0 and 1. Our normal system is base-10: It uses the digits from 0 to 9. The keleven system is base-11: It uses the digits from 0 to 9 with a keleven somewhere in there, too.

For clues about where keleven falls, look at the first equation, which we’d expect to equal 1,373 in our usual base-10 system. Disregard the tens and ones places, since they’d add up to less than 100 regardless of what system we’re using. Instead, focus on the hundreds place — 8+5 should equal 13, not 14, so there’s a clue there.

Given that, we know that some of the digits in the keleven system are “inflated” from their values in our normal system, thanks to the insertion of the made-up number. We know, for example, that “14” in the keleven system is either 15 or 16 in our usual base-10. (It could be 16 since we may hit keleven twice on our way to “14,” first while counting to 10, and then maybe also while counting to 4.) We also know that “8” and “5” could each be inflated by at most one, because they are single-digit numbers. That’s important because now we know “14” is not 16 in base-11. There is no way “8” and “5” can add up to 16 since, at most, “8” is 9 and “5” is 6. And so “14” is 15.

Phew! So let’s review what we know: Digits 5 and 8 are displaced upward, while the value of 4 was unchanged (otherwise “14” would have been 16 in base-11). This puts keleven between 4 and 5. You can verify that using the multiplication problem if you’re nervous.

That checks out, so we’ve cracked Kevin’s code.

Solution to last week’s Riddle 3

Congratulations to рџ‘Џ James Medhurst рџ‘Џ of Birmingham, England, winner of Riddle 3!

Life as an honors math student at Haslett High School can be quite challenging. Take, for example, the Statistics Acumen Aptitude Diagnostic (SAAD). The test has 100 questions. The questions have no words, but each has two bubbles, and students are asked to fill in one of them. A student choosing the correct answer to the first question will be rewarded with one point; an incorrect answer causes the student to lose one point. The test is taken on a computer, so the students know whether or not their answers are correct as they go. The second question is worth two points, the third is worth three points, and so on. A student also has the option to skip a question. A skipped question counts as zero points and also resets the progressively increasing point value back to one for the next question. What’s a strategy that will maximize scores on this exam?

A strange game. The only winning move is not to play. Our winner explained:

The complex presentation deceptively obscures the fact that, whatever strategy is adopted, each question is a coin flip with a mathematical expectation of zero (50 percent chance to win points, 50 percent chance to lose the same amount of points). Therefore, there is no way of increasing the expectation for the test as a whole. SAAD indeed. It would be tempting to devise a strategy that results in a very high probability of finishing with a small positive score and a very low probability of finishing with a catastrophically large negative score, but, if you were taking the test for money, this would be terrible bankroll management in the long term. This is just the kind of woolly thinking that can result in economic meltdown or nuclear war. Personally, if I were training the decision-makers of the future, I would only pass those students who skipped every question.

Solution to last week’s Riddle 4

Congratulations to рџ‘Џ Tom Singer рџ‘Џ of Melbourne, Florida, winner of Riddle 4!

You were faced with the grid below — a cornucopia of gorgeous fall leaves, ripe pumpkins, crisp apples, candy corn and acorns.4 Each one had a numeric value, and the darker squares along the edge were sums of the rows and columns adjacent to them.

This cornucopia was so close to having an elegant, integer solution: acorn = 0, leaf = 1, candy corn = 2, apple = 3 and pumpkin = 10. Unfortunately, the second column wasn’t quite right — it would add up to two pumpkins minus a leaf, rather than just two pumpkins.

Onward, undeterred — we can still solve this problem. As it turns out, acorn = 31/73, leaf = 62/73, candy corn = 0, apple = 310/73 and pumpkin = 837/73. Sometimes the holidays can get a bit messy.

This can be solved as a system of linear equations. We have five unknown variables (the five items in the cornucopia) and five equations without “?”s. That will give us enough information to solve for the unknown variables. That system looks like this (since we’re calling the acorns “A,” let’s call the apple “G,” for Granny Smith):

2L+5A+3C+2P+1G = 31

1A+2C+1G+4L+2P = 31

2L+1C+2G+1A+2A = P

5A+3L+3A+2C+4G = 2P


You could turn to the tools of linear algebra to help solve this: for example, the elimination of variables, row reduction, Cramer’s rule and matrix manipulation. Or … you could just toss this system into an online calculator, which is easy enough.

Want to submit a riddle?

Email me at


  1. Important small print: For you to be eligible, I need to receive your correct answer before 11:59 p.m. EST on Sunday. Have a great weekend!

  2. The cube is one by one by one. One diagonal runs from its (0,0,0) corner to its (0,1,1) corner. Another diagonal runs from its (0,1,0) corner to its (1,0,1) corner.

  3. The arrangement shows six knights in a circle, with the knights marked in alternating colors. One knight is shaking the hand of the knight directly across the circle from him, leaving two pairs of knights off to the sides who are shaking hands as well.

  4. The diagram is five rows by five columns. The five boxes in the first row contain, from left to right, two leaves, five acorns, three candy corns, two pumpkins, and one apple, which sum to 31. In the second row: one candy corn, three leaves, three apples, two apples, and two acorns, which sum to an unknown “?”. In the third row: two apples, three acorns, three leaves, one candy corn, and one pumpkin, which sum to an unknown “?”. In the fourth row: one acorn, two candy corns, one apple, four leaves, and two pumpkins, which sum to 31. And in the fifth row: two acorns, four apples, one pumpkin, two candy corns, and two leaves, which sum to an unknown “?”. The columns sum, from left to right, to one pumpkin, two pumpkins, 31, and two unknowns.

Oliver Roeder was a senior writer for FiveThirtyEight. He holds a Ph.D. in economics from the University of Texas at Austin, where he studied game theory and political competition.