# Can You Fold All Your Socks?

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 the next column. Please wait until Monday to publicly share your answers! If you need a hint or have a favorite puzzle collecting dust in your attic, find me on Twitter or send me an email.

## Riddler Express

From Ryan Nelson comes a puzzle related to the digital display of digits (for the second week in a row!):

A digital 12-hour clock displays 10 digits: two digits representing the hour (from â€ś00â€ť to â€ś12â€ť), two digits representing the minute, two digits representing the second and four digits representing the year.

When will the clock next use every digit from 0 to 9?

## Riddler Classic

From Anna KĂłmĂˇr comes a stumper about socks:

In my laundry basket, I have 14 pairs of socks that I need to pair up. To do this, I use a chair that can fit nine socks, at most. I randomly draw one clean sock at a time from the basket. If its matching counterpart is not already on the chair, then I place it in one of the nine spots. But if its counterpart *is* already on the chair, then I remove it from the chair (making that spot once again unoccupied) and place the folded pair in my drawer.

What is the probability I can fold all 14 pairs without ever running out of room on my chair?

*Extra credit:* What if I change the number of pairs of socks I own, as well as the number of socks that can fit on my chair?

## Solution to last weekâ€™s Riddler Express

Congratulations to đź‘Ź Eyal Minsky-Fenick đź‘Ź of New Haven, Connecticut, winner of last weekâ€™s Riddler Express.

Last week, I was cracking a safe with a two-digit passcode. (It wasnâ€™t a very secure safe.) Both digits were between 0 and 9, and when I typed in each digit, that digit was shown via a standard seven-segment display.^{2} Only the most recent digit I entered showed up on the single-digit display.

By pressing two different digits at the same time, the safe gave me the benefit of the doubt and opened if either ordering of the digits was the correct passcode. For example, if I pressed the 1 and the 2 at the same time, the safe opened if the passcode was either â€ś12â€ť or â€ś21.â€ť

Finally, I noted that the display wasnâ€™t functioning perfectly. Any segment that was part of a number in the passcode appeared to be slightly faded. This fade was visible even when the segment wasnâ€™t lit. And any segment that was part of *both *digits (if there were any such segments) were twice as faded.

Unfortunately, after some mental math, I realized that I still didnâ€™t have enough information to open the safe with confidence.

What were all the possible two-digit passcodes for the safe?

There were 10 possibilities for the first digit and another 10 possibilities for the second digit, so there were a total of 100 possible passcodes. Of these, 90 had a different first and second digit. Because you could press two different digits at the same time, that meant you could treat these 90 codes as just 45 codes. Including the 10 codes with the same first and second digit, that meant there were 55 distinct ways to try cracking open the safe.

Now, many of these 55 ways resulted in a unique pattern of faded segments. For example, consider the following seven-segment display:

The top segment and the two right segments are both very faded, while the middle and bottom segments are slightly faded. There is only one combination of two digits that could have resulted in this â€śfingerprint of fadesâ€ť: 3 and 7. If this was what I had seen when trying to crack the safe, the passcode would have been either 37 or 73. In either case, I could have pressed 3 and 7 together to open the safe.

However, not every pair of digits had a unique fingerprint â€” and thatâ€™s precisely what this riddle was all about. Many solvers, like Adam Davitt, worked out all 55 cases by hand (or spreadsheet) and found which two resulted in the same fingerprint. Others, like Andrea Andenna, wrote computer code to check these cases for them. Either way, here was what I must have seen on the safeâ€™s display:

In this case, the top-right and bottom-left segments were slightly faded, while the remaining segments were all very faded. This fingerprint could have been created by 5 and 8 (after all, it kind of looks like a faded 5), but also by 6 and 9. And so, because I couldnâ€™t immediately open the safe by seeing the fingerprint, the passcode must have been **58, 85, 69 or 96**.

Iâ€™ll leave it to you to guess which of these was the safeâ€™s actual passcode.

## Solution to last weekâ€™s Riddler Classic

Congratulations to đź‘Ź Laurent Lessard đź‘Ź of Toronto, Canada, winner of last weekâ€™s Riddler Classic.

Last week, you had a pizza to share with three of your friends. Among the four of you, everyone wanted a different amount of pizza. In particular, the ratio of appetites was 1:2:3:4. Therefore, you wanted to make two complete, straight cuts (i.e., chords) across the pizza, resulting in four pieces whose areas had a 1:2:3:4 ratio.

Where should you make the two slices?

First off, to keep the numbers relatively simple, letâ€™s suppose the pizza had an area of exactly 10 square units (since 1+2+3+4 equals 10).

Now, before slicing up the pizza, a good first step was to convince yourself that this was even solvable. One way to do that was to imagine two chords that split the circular pizzaâ€™s areas into two different ratios, such as 4:6 (i.e., 1+3:2+4) and 3:7 (i.e., 1+2:3+4). Independently rotating the chords about the center of the circle resulted in regions of different areas. For some orientation of the chords, the region with area 4 overlapped the region with area 3 to form a new region with area 1. At this point, the remainder of the region with area 4 formed a piece with area 3, while the remainder of the region with area 3 formed a piece with area 2. That left an area of 4 for the fourth and final piece. In other words, the ratio of the areas was indeed 1:2:3:4.

By picking different pairs of ratios that summed to 10 â€” or, equivalently, by having the four areas appear in a different order around the pizza â€” you could find six different solutions (i.e.,three pairs of reflected solutions). Laurent, this weekâ€™s winner, illustrated these solutions:

Many solvers, such as James Kilfiger, Jason Weisman and Thomas Stone, used trigonometry to determine specific coordinates and angles for the slices. For example, the solution in the bottom left consisted of a diameter and a second chord that intersected it about 34 percent of the way along the radius, forming an angle of almost 70 degrees.

For extra credit, you had to split the pizza among an even greater number of friends, while still (1) having half as many cuts as people and (2) having all the cuts pass through a single point. With *six* friends sharing the pizza, it turned out that there was no way to achieve a perfect 1:2:3:4:5:6 ratio among the areas of the pieces. And with *eight* friends, a perfect 1:2:3:4:5:6:7:8 ratio was similarly impossible.

Instead of exact solutions, Laurent found cuts that minimized the sum of the square differences between the areas and the desired areas. Below are his optimal slices for six and eight people:

## Want more puzzles?

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.