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 Jordan Pujol, a chess match problem:

The World Chess Championship is underway. It is a 12-game match between the world’s top two grandmasters. Many chess fans feel that 12 games is far too short for a biennial world championship match, allowing too much variance.

Say one of the players is better than his opponent to the degree that he wins 20 percent of all games, loses 15 percent of games and that 65 percent of games are drawn. Wins at this match are worth 1 point, draws a half-point for each player, and losses 0 points. In a 12-game match, the first player to 6.5 points wins.

What are the chances the better player wins a 12-game match? How many games would a match have to be in order to give the better player a 75 chance of winning the match outright? A 90 percent chance? A 99 percent chance?

## Riddler Classic

From Steven Brown, some balls, some cups and some questions about them:

You’re going to play a game. Like many probability games, this one involves an infinite supply of ping-pong balls. No, this game is not *quite* beer pong.

The balls are numbered 1 through N. There is also a group of N cups, labeled 1 through N, each of which can hold an unlimited number of ping-pong balls. The game is played in rounds. A round is composed of two phases: throwing and pruning.

- During the throwing phase, the player takes balls randomly, one at a time, from the infinite supply and tosses them at the cups. The throwing phase is over when every cup contains at least one ping-pong ball.
- Next comes the pruning phase. During this phase the player goes through all the balls in each cup and removes any ball whose number does
*not*match the containing cup.

Every ball drawn has a uniformly random number, every ball lands in a uniformly random cup, and every throw lands in some cup. The game is over when, after a round is completed, there are no empty cups.

How many rounds would you expect to need to play to finish this game? How many balls would you expect to need to draw and throw to finish this game?

*Extra credit:* It’s been quite a while, so it’s time to offer up a 🏆 Coolest Riddler Extension Award 🏆. What if the game weren’t so simple? What if you could aim? What if you could miss? The most interesting twist on this game earns a shiny emoji trophy.

## Solution to last week’s Riddler Express

Congratulations to 👏 Jochem van Gaalen 👏 of Detroit, winner of last week’s Riddler Express!

Last week brought a puzzle of telephonic coincidence. Assume that landlines and cellphone numbers in your area code are assigned randomly, such that a person is equally likely to get any of the 10,000,000 numbers between and including 000-0000 to 999-9999. What is the probability that the last seven digits of the cell number are an “exact scramble” — that is, it has all the same digits but is not the same number — of the last seven digits of our landline?

The chances are tiny — about **0.017 percent**.

This puzzle’s submitters, Dave Moran and family, explain why:

Importantly for our purposes, a phone number can have digits in different types of combinations. All seven digits could be different, for example — 918-4276. Or all seven could be the same. Or we could have a phone number with three sets of two of the same digit plus one other unique digit — 226-6114. And so on. There are 15 of these types of digit combinations.

For each type, we can calculate how many of the 10,000,000 total possible phone numbers fall into that configuration, which will give us the probability that the landline has that configuration. For example, there are 1,058,400 seven-digit phone numbers in which one digit is repeated three times, another appears twice, and two other digits appear once each. We could call that particular configuration 3A 2B C D — digit A appears three times, B twice, C and D once.

Then, for each configuration, we can calculate how many “exact scrambles” there would be of a given specified number in that configuration. For the 3A 2B C D configuration, there are 419 exact scrambles, calculated by \(7!/(3!2!1!1!) - 1\). (The “\(-1\)” comes from the fact that we need to *exclude* the original number.)

Finally, we can multiply the number of exact scrambles associated with each configuration by the number of phone numbers *with* that configuration, summed up over the 15 possible configurations, and divided by \(9.999999 \cdot 10^{14}\) — that’s the number of possible landline numbers multiplied by the number of possible cell numbers (one shy of 10,000,000 because the landline number is already taken).

##### What are the chances your phone numbers match?

The number of phone numbers by the configuration of their digits

Configuration | Number of landline numbers | Number of cellphone numbers |
---|---|---|

7A | 10 | 0 |

6A 1B | 630 | 6 |

5A 1B 1C | 15,120 | 41 |

5A 2B | 1,890 | 20 |

4A 2B 1C | 75,600 | 104 |

4A 3B | 3,150 | 34 |

4A 1B 1C 1D | 176,400 | 209 |

3A 3B 1C | 50,400 | 139 |

3A 2B 2C | 75,600 | 209 |

3A 2B 1C 1D | 1,058,400 | 419 |

3A 1B 1C 1D 1E | 1,058,400 | 839 |

2A 2B 2C 1D | 529,200 | 629 |

2A 2B 1C 1D 1E | 3,175,200 | 1,259 |

2A 1B 1C 1D 1E 1F | 3,175,200 | 2,519 |

1A 1B 1C 1D 1E 1F 1G | 604,800 | 5,059 |

Multiplying the numbers in the second column by the numbers in the third column and then dividing by 10,000,000×9,999,999 gives 0.0001676, or about 0.017 percent.

## Solution to last week’s Riddler Classic

Congratulations to 👏 Richard Judge 👏 of Louisville, Kentucky, winner of last week’s Riddler Classic!

Last week brought a sports calendar scheduling challenge. The Riddler Sports League’s season was about to begin. Sixteen teams, with strengths ranging from 1 to 16, were taking part. Every team was set to play other team once, with the schedule randomly determined at the start of the season. The games’ outcomes are decided probabilistically.^{2}

The title winner(s) were whoever had the most points at the end of the season. But everybody in Riddler Nation was so busy that they didn’t have time to play every game. Rather they’d play only until a title winner was mathematically determined. On opening day, every team played its first game. Afterward, one specifically chosen game was played each day. Each chosen game must be the next scheduled game for at least one of the participating teams. Your challenge, as head of the Ministry of Sport, was to craft an algorithm that chose the next played game such that the median number of games across a thousand simulated seasons is as small as possible.

What is that number? What is the theoretical fewest games it would take?

The essential question we’re facing is which game should be played to minimize the total number of games required. So how do we choose? Our winner, Richard, shared a nice write-up of his scheduling approach, along with his code. This is a lightly edited version of how he described his instructive algorithmic approach:

I tried several different algorithms to arrive at the minimum number of games. At first I tried always choosing the team which currently had the most points. After running this algorithm over 1,000 seasons I got the median number of games down to 85. That seemed pretty good, but I was pretty sure we could bring this down. [Editor’s note: Classic Riddler Nation persistence.]

Then I added in a check to see if a tie for the championship had been reached earlier in the season instead of just waiting for an outright title win. Adding this to the algorithm brought the median down to 80. Even better, but I still wasn’t satisfied. [Editor’s note: Ditto.]

Up until then, I had been forcing whichever team had the most points to play. But I switched that up and instead used whichever team had the *potential* to get the most points. A team that had not lost a game yet, for example, had a potential to have 30 points at the end of the league. A team that had lost twice, on the other hand, only had a potential of 26 points. (If there was a tie for potential, I chose whichever team had the most strength.) This brought the median down to **70 games**. I tried to alter this algorithm more past this, but every new algorithm increased the median.

The theoretical minimum number of games is 22, which you get for playing the eight games the first day and then picking one team 14 times wherein they win every single game — they end with 30 points and every other team could earn at most 28 points.

## Want more riddles?

Well, aren’t you lucky? There’s a whole book full of the best of them and some never seen before, called “The Riddler,” and it’s in stores now!

## Want to submit a riddle?

Email me at oliver.roeder@fivethirtyeight.com.