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

A manager is trying to produce sales of his companyâs widget, so he instructs his team to hold a sale every morning, lowering the price of the widget by 10 percent. However, he gives very specific instructions as to what should happen in the afternoon: Increase the price by 10 percent from the sale price, with the (incorrect) idea that it would return it to the original price. The team follows his instructions quite literally, lowering and then raising the price by 10 percent every day.

After *N* days, the manager walks through the store in the evening, horrified to see that the widgets are marked more than 50 percent off of their original price. What is the smallest possible value of *N*?

## Riddler Classic

This weekâs Riddler Classic features several puzzles, independently submitted by Tyler Barron and Angela Zhou, about the game SET.

In SET, there are 81 total cards, and each card contains has four attributes:

*Number:*Each card has one, two or three shapes on it.

*Shape:*Each shape on a card is identical, and can be oval, diamond or âsquiggle.â

*Color:*Each shape on a card is identical in color, which can be red, green or purple.

*Shading:*Each shape on a card is identical in shading, which can be solid, shaded or outlined.

Here is a âboardâ of 12 such cards:

Importantly, a âsetâ (not to be confused with the gameâs title) of cards consists of three cards that are either all alike or all different in each attribute; if two of the cards have a common attribute that is not shared by the third, they cannot be a set.

For example, in the image above, the single diamond in the left column and the top and bottom cards in the right column form a set. They each have different numbers (one, two and three), different shapes (diamond, squiggle and oval), the same color (red) and the same shading (shaded). If you look carefully, you might also find other sets within this board of 12 cards.

*Question 1:* What is the maximum number of cards you could have (from a single deck of 81 cards) such that there are *no* sets among them?

*Question 2: *What is the largest number of sets one can possibly find among 12 cards? You are free to pick any board of 12 cards you like â your goal is to maximize the number of sets the board contains.

*Question 3:* If you pick 12 cards at random (again, from a single deck of 81 cards), whatâs the probability that they contain *at least one* set?

## Solution to last weekâs Riddler Express

Congratulations to đ Lazar Ilic đ of Austin, Texas, winner of last weekâs Riddler Express.

Last week, you were looking for powers of 2 that came very close to powers of 10. For example, 2^{10} equals 1,024, which is very close to 1,000, or 10^{3}. After 2^{10}, what was the next (whole number) power of 2 that came even closer to a power of 10? (To be clear, âcloserâ didnât refer to the absolute difference â it meant your power of 2 needed to differ from a power of 10 by less than 2.4 percent.)

One way to find the answer was by brute force: calculating powers of 2 and checking how close they came to a power of 10. Solver Eugene Tsai did exactly this, with a lengthy spreadsheet to show for it.

Another approach made use of logarithms. You were looking for whole numbers *A* and *B* such that 2*A* â 10*B*. Taking the base 10 logarithm of both sides and rearranging gave the expression *B*/*A* â log_{10}2. In other words, you were looking for a fraction that approximated log_{10}2, which itself is about 0.301, and you wanted the denominator of your fraction, *A*, to be as small as possible.

So what were some fractions that were good approximations for 0.301? Well, 1/3 came to mind, which meant 2^{3} â 10^{1}. I mean, sure, 8 is pretty close to 10. The next, better approximation was 3/10, which was *quite* close to 0.301. That meant 2^{10} â 10^{3}. However, at this point, weâve merely caught up to the original puzzle. So what was the next, better fractional approximation for log_{10}2 after 3/10?

Solver Tejas Guruswamy used a technique known as âcontinued fractions,â which do exactly what we want â they tell you the best fractional approximations for different numbers, including irrational numbers like log_{10}2. Meanwhile, solvers Matthew Miller and Dennis Okon both noted that thereâs an OEIS sequence for what weâre looking for. (Isnât there always?) Any which way, the next approximation for log_{10}2 was 28/93, which meant 2^{93} â 10^{28}. In fact, 2^{93} is approximately 0.9904 Ă 10^{28}, only 0.96 percent less than 10^{28} â and so **2 ^{93}** was the correct solution.

Many solvers offered an answer of 2^{103}, which was 1.4 percent greater than 10^{31}. However, the original problem didnât specify that the power of 2 had to be *greater* than its corresponding power of 10, so 2^{103} was not the correct answer.

A final approach worth mentioning was to graphically analyze the problem using polar coordinates, inspired by 3Blue1Brownâs related video on prime numbers.

In the animation above, each point represents a power of 2. The pointâs distance from the origin is its power of 2 (so, for example, 2^{7} is a distance of 7 from the origin). The pointâs angle, meanwhile, indicates how close that power of 2 comes to a power of 10, with an angle of zero degrees meaning itâs an exact power of 10. Here, weâre interested in the points that came closest to the zero-degree axis, labeled in red. Reading them off, they were: 3, 10, 93, 196, 485, 2,136, 13,301, 28,738, 42,039, and 70,777. These were exactly the powers of 2 that came progressively closer to powers of 10 in the aforementioned OEIS sequence!

In case you were curious, 2^{70,777} equals 1.00000716 Ă 10^{21,306}. Pretty darn close to a power of 10!

## Solution to last weekâs Riddler Classic

Congratulations to đ Donald M. đ of Dallas, Texas, winner of last weekâs Riddler Classic.

Last week, you paid another visit to Tiffanyâs barbershop. But this time, the riddle was stated slightly less ambiguously than it had been during your first visit.

This time, all of Riddler City decided to get a haircut at Tiffanyâs, and everyone lined up at the entrance in a random order a few minutes before the shop opened at 8 a.m. After opening, the shopâs four barbers started cutting hair for their first customers at random times between 8 a.m. and 8:15 a.m. Each haircut then lasted exactly 15 minutes.

Also, each person in line had a 25 percent of preferring Tiffany. Whenever such a person was at the front of the line, if a barber *other *than Tiffany became available, theyâd allow the person behind them to skip them in line âŠ unless, of course, that person *also* preferred Tiffany, in which case the third person in line would skip both of them âŠ unless, of course that person *also* *also* preferred Tiffany â you get the idea.

Sadly, you found yourself toward the back of this very, very long line. To pass the time while you waited, you spent a long time thinking about last weekâs Riddler column, completely unaware of the passage of time. The next thing you knew, you were second in line, with one person waiting in front of you. At this point, how long should you expect to wait for your haircut from Tiffany?

Now, you might have thought that the person in front of you had a 25 percent chance of preferring Tiffany. Surprisingly, that wasnât right. Over time, as more people got their hair cut, a backlog of Tiffany fans built up at the front of the line, while the non-Tiffany customers were weeded out.

Think of the line of customers as a string of *T*s (the Tiffany fans) and *U*s (the non-Tiffany customers). Over the course of each 15-minute cycle, Tiffany and the other three barbers each took turns picking a customer â Tiffany took the next in line, regardless of whether that person was a *T* or a *U*, while the other three barbers took the next available *U*. After a few cycles, all the early *U*s would have been taken by the other three barbers, leaving a whole bunch of *T*s at the head of the line. Over time, the number of *T*s at the front continued to grow with the total number of customers. (The average number of leading *T*s after *N *15-minute cycles of four haircuts looked suspiciously like the square root of *N*. But asking you to prove that would have been worthy of yet another Riddler!)

That meant, as solver Jason Shaw verified with code, that as the number of customers in front of you went to infinity, the probability the person in front of you was also a *T* approached 1. Since Riddler City had a very, very large population, it was safe to assume that the person in front of you was *definitely* a Tiffany fan. Thus, you had to wait an average of 7.5 minutes for Tiffany to finish her current haircut, and then another 15 minutes for the person in front of you, for a grand total of **22.5 minutes**.

An alternate, even more challenging interpretation of the problem some readers had was that, after your long wait outside the barbershop, you found yourself second in line, with *all four barbers currently *cutting hair. This was indeed a different scenario, since after a long time you would have expected the other three barbers to have serviced all the *U*s in the line, leaving nothing but *T*s (i.e., only Tiffany was left cutting hair).

Needless to say, Tiffany and her team of barbers clearly specialize in mathematical extensions. (See what I did there?)

## 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.