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.

## Riddler Express

You have two 16-ounce cups â cup A and cup B. Both cups initially have 8 ounces of water in them.

You take half of the water in cup A and pour it into cup B. Then, you take half of the water in cup B and pour it back into cup A. You do this again. And again. And again. And then many, many, many more times â always pouring half the contents of A into B, and then half of B back into A.

When you finally pause for a breather, what fraction of the total water is in cup A?

*Extra credit:* Now suppose both cups initially have somewhere between 0 and 8 ounces of water in them. You donât know the precise amount in each cup, but you know that both cups are not empty. Again, you pour half the water from cup A into cup B, and then half from cup B back to A. You do this many, many times. When you again finally pause for a breather, what fraction of the total water is in cup A?

The solution to this Riddler Express can be found in the following column.

## Riddler Classic

From Graydon Snider comes a one-way trip to a tangle of grids:

In Riddler City, all the streets are currently two-way streets. But in an effort to make the metropolis friendlier for pedestrians and cyclists, the mayor has decreed that all streets should be one-way. Meanwhile, the civil engineer overseeing this transition is not particularly invested in the project and will be randomly assigning every block of each street a random direction.

For your daily commute to work, you drive a car two blocks east and two blocks south, as shown in the diagram below. What is the probability that, after each block is randomly assigned a one-way direction, there will still be a way for you to commute to work while staying within this two-by-two block region (i.e., sticking to the 12 streets you see in the diagram)? Here is one such arrangement of one-way streets that lets you commute to work:

And no, you canât get out of your car to hop on a bike or walk. I mean, you *can*, but not in this puzzle.

The solution to this Riddler Classic can be found in the following column.

## Solution to last weekâs Riddler Express

Congratulations to đAndrew Ford đ of Madison, Wisconsin, winner of last weekâs Riddler Express.

Last week, you and 2021 Regeneron Science Talent Search winner Wenjun Hou were playing a game in which you alternated taking turns, removing pennies from a pile. On your turn, you could remove either one or two pennies from the pile. On Wenjunâs turn, he could remove either two or three pennies. Whoever took the last penny *lost*. (If there was only one penny left and it was Wenjunâs turn, then he skipped his turn, which meant you would lose). Suppose both you and Wenjun played optimally.

1) If you went first, then what initial numbers of pennies meant *you* would win the game?

2) If Wenjun went first, then what initial numbers of pennies meant *he* would win the game?

Letâs call the initial number of pennies in the game *N*. An efficient way to solve these problems simultaneously was to look at smaller values of *N* and then work your way toward larger values. For starters, when *N* = 1, you lost, since you were the only one who could take a penny. Next, when *N* = 2 and it was your turn, you lost again â you could either take one penny, resulting in *N* = 1 and a loss for you, or take two pennies, meaning you took the last penny and therefore lost. But when *N* = 2 and it was Wenjunâs turn, he had to take both pennies, meaning you won.

From there, it was on to *N* = 3, again considering the separate cases of whose turn it was. If it was your turn, you could take one penny, so that *N* = 2 and it was now Wenjunâs turn. As we just said, this meant you would win! If it was Wenjunâs turn with *N* = 3, he could take two pennies, leaving you with *N* = 1 and a loss.

At this point, solvers like Betts Slingluff got a sense of a broader strategy. If it was your turn, then for any given value of *N*, then you could remove one coin (in which case it would then be Wenjunâs turn with *N*â1 coins) or two coins (in which case it would then be Wenjunâs turn with *N*â2 coins). You could look to see if either option resulted in a victory for you, and that would dictate whether you took one or two. Meanwhile, Wenjun would operate under a similar strategy, looking at what would happen when it was your turn with either *N*â2 or *N*â3 coins. And should either of you deviate from your optimal strategy, the other would seize the upper hand.

The following table illustrates these strategies. On your turn, look one or two rows up in Wenjunâs column to see if you can win. Wenjun will look up two or three rows in your column to see if he can win.

Your turn | Wenjunâs turn | |
---|---|---|

1 | Wenjun | Wenjun |

2 | Wenjun | You |

3 | You | Wenjun |

4 | You | Wenjun |

5 | Wenjun | Wenjun |

6 | Wenjun | You |

7 | You | Wenjun |

8 | You | Wenjun |

9 | Wenjun | Wenjun |

10 | Wenjun | You |

11 | You | Wenjun |

12 | You | Wenjun |

Most solvers saw the resulting pattern:

- When you went first, you would win if
*N*was a multiple of 4 or a multiple of 4 plus 3, also known as**0 or 3 (mod 4)**. - When Wenjun went first, he would win if N was a multiple of 4, a multiple of 4 plus 1 or a multiple of 4 plus 3, also known as
**0, 1 or 3 (mod 4)**.

For a more rigorous explanation of these results, check out write-ups by solvers Eli Wolfhagen and Rohan Lewis.

And while the column didnât ask for this, another quirky outcome of this game was that if you randomly selected a number of coins and who went first, you had a 37.5 percent chance of winning, versus Wenjunâs 62.5 percent chance. Wenjunâs edge of being allowed to pass when there was just one coin turned out to be quite the advantage.

## Solution to last weekâs Riddler Classic

Congratulations to đBrian Auriti đ of Morrisville, North Carolina, winner of last weekâs Riddler Classic, which came from Timothy Qian, another winner of this yearâs Science Talent Search.Â

Last week, you were asked four seemingly arbitrary true-or-false questions by the Sphinx on a topic you knew absolutely nothing about. Before the first question was asked, you had exactly $1. For each question, you could bet any non-negative amount of money that you would answer correctly. That is, you could bet any real number (including fractions of pennies) between zero and the current amount of money you had. After each of your answers, the Sphinx revealed the correct answer. If you were right, you gained the amount of money you had bet; if you were wrong, you lost the money you had bet.

However, there was a catch. (Isnât there always, with the Sphinx?) The answer would *never* be the same for three questions in a row.

With this information in hand, what was the *maximum* amount of money you could be sure that you would win, *no matter what* the answers wound up being?

At first, it might have seemed implausible that you could guarantee *any* winnings from the Sphinx, given the capricious nature of its answers. But sure enough, it was possible to leverage the Sphinxâs constraint to your advantage.

There were a total of 10 answer combinations to the four questions that had no three-peats: TTFT, TTFF, TFTT, TFTF, TFFT, FTTF, FTFT, FTFF, FFTT and FFTF. You had no information about what the Sphinx would answer for the first question, so you bet nothing. For the second question, six of the 10 cases had a second answer that was different from the first, so suppose you bet *x* that it would be different.

At this point, you were down to 1â*x* dollars for the cases TTFT, TTFF, FFTT and FFTF. But for all four of these, you *knew* that the third answer had to differ from the first two, which meant you could double your money. That left you with 2â2*x* dollars going into the fourth question. With no leverage on the information here, you sat right with 2â2*x* dollars in the end.

Alternatively, you were up to 1+*x* dollars for the cases TFTT, TFTF, TFFT, FTTF, FTFT and FTFF. Notice that two-thirds of the time, the third answer differed from the second. While it wasnât a sure thing, it *was* worth betting on. Suppose, in this case, you bet *y* dollars that the third answer would differ from the second. If you were right, then you had 1+*x*+*y* dollars in the end, since you couldnât make guaranteed money on the last question. If you were wrong, then you had 1+*x*â*y* dollars, which you could *double up* on the last question, lest the Sphinx give the same answer three times in a row.

Putting this all together, depending on the Sphinxâs answers, you could win 2â2*x* dollars, 1+*x*+*y* dollars or 2+2*x*â2*y* dollars. From here, you were free to choose any value of *x* between 0 and 1 and any value of *y* between 0 and 1+*x*. Due to the tradeoffs among these three possible winnings, your *guaranteed* winnings were maximized when all three of these values were equal. The expressions 2â2*x*, 1+*x*+*y* and 2+2*x*â2*y* all equaled 8/5 when *x* was 1/5 and *y* was 2/5.

That meant with four questions, such that three in a row never had the same answer, you were guaranteed winnings of 8/5 dollars, or **$1.60**. (Note: You invested $1 to win $1.60, so I also accepted answers of $0.60, which represented your profit from this game.)

For extra credit, you generalized the game so that the Sphinx asked *N* questions, such that the answer was never the same for *Q* questions in a row. What were your maximum guaranteed winnings in terms of *N* and *Q*?

This general version of the problem had a surprising relationship to Fibonacci numbers. As solvers Laurent Lessard showed, your maximum guaranteed winnings were 2^{N}^{â1} divided by the *N*+1 term in the sequence of Fibonacci (*Q*â1)-step numbers. The following graph, courtesy of Laurent, shows your guaranteed winnings as a function of *N* and *Q*:

Take that, Sphinx!

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