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,^{10} 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 James Anderson, in which you unwrap your presents and they are promptly eaten:

For Christmas, you received a 20-volume encyclopedia (thanks, Mom) that now sits on your shelf in numerical order. Each volume is 2 centimeters thick and bound with a 2-millimeter thick hardcover. If an ambitious bookworm wriggles into Volume 1 and eats straight from Page 1 of that book to the last page of Volume 20, how far has it traveled?

## Riddler Classic

From Jordan Ellenberg, an author and mathematician at the University of Wisconsin, so simple yet so hard:

What are these bits?

Jordan shared this puzzle previously with some folks, and has this preliminary report for Riddler Nation: “To my amazement, three people figured it out — all mathematicians, but that partially reflects who’s on my feed, and the solution is actually in some sense elementary.”

I’ve got a hunch Riddler Nation will add significantly to that total.

## Solution to the previous Riddler Express

Congratulations to Tracy Hall of Provo, Utah, winner of the previous Riddler Express!

Two weeks ago, we learned that Santa Claus’ memory was faltering. It was faltering so much, in fact, that he’d forgotten the order in which his eight reindeer were meant to be harnessed to his sleigh. The reindeers themselves remembered where they were supposed to go, but, being animals, could only give out a grunt of approval if they were harnessed in the right position. Santa decided on the following strategy to get everybody hooked up correctly: He created a list of all eight reindeer in random order. He then went to the first location, harnessing the reindeer one by one off his list until one grunted, then moving on to the next location and starting over at the top of his list. Each harnessing took one minute. How long on average would we expect it to take before all the reindeer are correctly harnessed and Santa can get to work delivering presents?

It would take **22 minutes** on average.

Because the initial list of reindeer is random, it is equally likely that any of Santa’s attempts to harness the reindeer in the first location is correct. Therefore, to harness the first animal would take an average of (1 + 2 + 3 + 4 + 5 + 6 + 7 + 8) / 8 = 4.5 minutes. Similarly, to harness the second would take an average of (1 + 2 + 3 + 4 + 5 + 6 + 7) / 7 = 4 minutes, and so on. That’s a total of 4.5 + 4 + 3.5 + 3 + 2.5 + 2 + 1.5 + 1 = 22 minutes.

Santa could, of course, get really lucky with his random list, and get each one right on the first try for a total of eight minutes of harnessing. Or he could get really unlucky, taking the maximum amount of time with each reindeer for a total of 36 minutes of harnessing. More likely, it would be somewhere in between. This puzzle’s submitter, Taylor Firman, provided the following chart of the distribution of possible reindeer-harnessing times that Santa *could* face:

Good luck with your draw from that probability distribution, big jolly guy. We’re counting on you.

## Solution to the previous Riddler Classic

Congratulations to David Mattingly of Old Forge, Pennsylvania, winner of the previous Riddler Classic!

Two weeks ago, we also traveled to Santa’s workshop in which elves worked shifts building toys. During these shifts, Christmas music played on an overhead speaker, with songs chosen by a program at random from a large playlist. Every time he heard a song twice, a cranky elf named Cranky started throwing snowballs at everyone. This happened during about half of all shifts. During a shift, the elves hear 100 total songs. How large is Santa’s playlist?

It contains **7,175 songs**.

This puzzle is quite similar to the birthday problem — which is concerned with the chances that some two people in a group share a birthday — with an unknown number of days in a year, or songs on the playlist, in our case. So instead of 365 days and a 50 percent chance of a birthday match in a group of 23 people, we have an unknown number of songs and a 50 percent chance of a match in a group of 100 songs.

Let’s say there are *X* songs on the playlist. The chance of there *not* being a repeated song during a 100-song shift, a familiar equation from the birthday problem, is:\(\)

\begin{equation*}\frac{X!}{X^{100}(X-100)!}\end{equation*}

So the chance of there being a match is 1 minus that. That expression equals 0.5 right around when *X* = 7,175. Solver Hernando Cortina created the chart below using many elf shift simulations, and it shows how the probability of hearing a repeat song decreases as the playlist becomes larger. The probability hits our 50 percent mark very near 7,175 songs.

One of the founders of the music service Pandora, Joe Kennedy, wrote in to say the “situation the problem highlights is actually very real.” [*Editor’s note*: Ah yes, The Riddler, that staunch bastion of realism!] “For the many people whose favorite Christmas song is ‘All I Want for Christmas Is You,’ there just aren’t 7,174 other Christmas songs like it. And 100 Christmas songs typically only represent five to six hours of listening — less than a day’s effort in Santa’s workshop!”

## 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 me at [email protected]