# Can You Build The Longest Ladder?

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

From Starvind comes a matter of a frustrating (but not terrifying) tower:

You are on the 10th floor of a tower and want to exit on the first floor. You get into the elevator and hit 1. However, this elevator is malfunctioning in a specific way. When you hit 1, it correctly registers the request to descend, but it randomly selects some floor below your current floor (including the first floor). The car then stops at that floor. If it’s not the first floor, you again hit 1 and the process repeats.

Assuming you are the only passenger on the elevator, how many floors on average will it stop at (including your final stop, the first floor) until you exit?

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

## Riddler Classic

From Michael Branicky comes puzzle of primes and their connections:

As you may know, a *word ladder* is a sequence of words in which exactly one letter changes from one word to the next. And an *optimal* word ladder is a word ladder that gets you from the initial word to the final word using as few other words as possible. For example, to go from DOG to CAT, an optimal word ladder has just four total words (including DOG and CAT): DOG, DOT, COT and CAT.

For this puzzle, Michael similarly defines optimal *prime* ladders. Every number in the ladder must be prime, with exactly one digit changing from one number to the next. For example, here is an optimal prime ladder that goes from 97 to 53 with just four total numbers: 97, 17, 13 and 53.

This is tied for the *longest* optimal prime ladder consisting of two-digit primes. What is the longest optimal prime ladder for three-digit primes? Four-digit primes? Five-digit primes?

*Extra credit: *What is the longest optimal prime ladder for six-digit primes?

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

## Solution to last week’s Riddler Express

Congratulations to ÑÐ±âÑÐ±Ã·âÐ±âÐ±â¤ÐÐ±â Chris Magiera ÑÐ±âÑÐ±Ã·âÐ±âÐ±â¤ÐÐ±â of New York City, winner of last week’s Riddler Express.

Last week, you looked at fractions with a numerator of 1 whose decimal expansions didn’t go on for infinitely many decimal places. For example, 1/4 was equivalent to the decimal 0.25, and 1/500 was equivalent to 0.002. However, the decimal expansion of 1/3 was 0.33333 …, a decimal that never terminated.

If you were to add up all these numbers — fractions with a numerator of 1 whose decimal expansions don’t go on forever — what would be the sum? (Note: The fraction 1/1 was included in this group.)

First of all, what sorts of fractions terminated? In descending order, they were 1/1, 1/2, 1/4, 1/5, 1/10, 1/20, 1/40, 1/50, 1/100, 1/125 and so on. What was the common link between all these fractions? The only factors of their denominators were powers of 2 and 5. (And that included 1/1, whose denominator of 1 was equal to 2^{0}·5^{0}.)

By the way, the reason 2 and 5 were special in this regard was because we work in base 10, and 2 and 5 are the factors of 10. If we were to use a different base, such as base 15, then a fraction would terminate if its denominator consisted of powers of 3 and 5 rather than 2 and 5.

At this point, you had to find the sum of an infinite series of fractions. However, this wasn’t a straightforward geometric series, where each term is a multiple (less than 1) of the term before it. For example, while 1/4 is just 50 percent of its preceding term in the sum (1/2), 1/125 is 80 percent of its preceding term (1/100).

Solver Christopher Clark recognized that one way around this challenge was to reorganize the terms into *multiple* geometric series, based on their power of 5. Fractions whose denominator didn’t contain a positive power of 5 included 1/1, 1/2, 1/4, 1/8, etc. These formed a geometric series, whose sum was 2. Next, the fractions whose denominator had exactly one factor of 5 included 1/5, 1/10, 1/20, 1/40, etc., and *their* sum was 2/5. If you kept adding up these geometric series, their sums were 2, 2/5, 2/25, 2/125, etc. — *another* geometric series! This time, the sum was 5/2, or **2.5**. That was a surprisingly small result, all things considered.

Solver Winston Luo arrived at the same answer a different way. He multiplied two infinite geometric series together: (1/1 + 1/2 + 1/4 + 1/8 + 1/16 + …) · (1/1 + 1/5 + 1/25 + 1/125 + 1/625 + …). The first series contained all the fractions whose denominators were powers of 2, while the second contained all the fractions whose denominators were powers of 5. To find the product of these two expressions, you can multiply each term from the first by each term in the second, which gives you … every fraction whose denominator consists of powers of 2 and 5!

The first series in the product had a sum of 2, while the second series has a sum of 5/4. Multiplying these together indeed gives the correct answer of **2.5**.

It’s pretty neat how adding up a geometric series’ worth of geometric series was mathematically equivalent to *multiplying* two geometric series.

## Solution to last week’s Riddler Classic

Congratulations to ÑÐ±âÑÐ±Ã·âÐ±âÐ±â¤ÐÐ±âMichael DeLyser ÑÐ±âÑÐ±Ã·âÐ±âÐ±â¤ÐÐ±â of State College, Pennsylvania, winner of last week’s Riddler Classic.

Last week, the New York Nicks were facing off against the Brooklyn Naughts. Throughout the entire game, the two teams alternated possession, starting with the Nicks, until both teams had exactly 100 possessions. For simplicity, you assumed that each team scored either 0 points or 2 points with each possession. (So you didn’t have to worry about 3-pointers, fouls, etc.)

Whenever the game was tied, the team that currently had possession had a 50 percent chance of scoring 2 points. When the game was not tied, the team that was in the lead took it easy and the team that was behind was more motivated to score. In this case, you assumed that the team that was behind had a 50+*x* percent chance of scoring, while the team that was ahead had a 50−*x* percent chance of scoring. Here, *x* was a positive number that was greater than 0 and less than 50.

In preparation for the game, the official scorekeeper (who knew the value of *x*) crunched the numbers and realized the game had a 50 percent chance of being tied at the end of regulation.

In the event that the game was *not* tied at the end of regulation, what was the probability that each team won?

A few readers took a careful look at this puzzle and concluded that neither team could possibly hold an advantage over the other. The conditions *appeared* to be perfectly symmetric, which meant both teams had a 50 percent chance of winning. But as sensible as this reasoning might have sounded, it was flawed. The symmetry of the game was broken by the simple fact that the Nicks had the first possession, while the Naughts had the second possession (as well as the last).

To see how that played out, let’s compare how the teams were doing after just one possession each. Initially, the score was tied at 0, which meant after the Nicks’ first possession there was a 50 percent chance the Nicks were up 2-0 and a 50 percent chance the game was tied 0-0. In the event the game was tied heading into the Naughts’ possession, there was a 50 percent chance the Naughts went up 2-0 and a 50 percent chance the game remained tied 0-0. But when the Nicks had scored, there was a 50+*x* percent chance the Naughts evened things up 2-2, and just a 50−*x* percent chance the Nicks retained their 2-0 lead. And so, after both teams had one possession each, the Naughts had a 25 percent chance of being ahead, while the Nicks had only a 25−*x*/2 percent chance of being ahead. *Advantage, Naughts!*

Again, that was when each team had one possession. When each team had 100 possessions, the math got a little hairier. Most solvers turned to their computers for help. Colin Parker wrote some code in Python, while Paige Kester used spreadsheets. Both found that *x* had to be 25 (i.e., the chances of scoring when behind were 75 percent and when ahead were 25 percent) for there to be a 50 percent chance of a tie at the end of regulation. And of the remaining 50 percent of games that were *not* a tie, **the Naughts won 75 percent and the Nicks won 25 percent**.

Solver Maxim Wang illustrated how these probabilities depended on the value of *x*. In the graph below, the horizontal axis represents different values of *x* from -50 (on the left) to 50 (on the right). The orange region represents a Nicks victory, the black region a Naughts victory and the gray region a tie. When *x* was zero, that was when the game was truly symmetric and both teams had equal chances of victory. The red line shows when *x* was 25, and there was indeed a 50 percent chance of a tie. Sure enough, you can make out the significant advantage the Naughts had.

A few solvers, like Emma Knight, attempted an analytical solution to the puzzle. Emma noted that after 100 possessions each, the game had virtually reached a steady state. Emma used this fact to set up a system of equations and prove that *x* had to be 25, and that the Naughts consequently had a 75 percent chance of winning.

Unfortunately, the Brooklyn Naughts got swept by the Boston Concentrics in the playoffs.

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