How Many Numbers Contain The Numbers Of Their Numbers?

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 Daz Voss, numbers of numbers with numbers of their numbers:

The number 21322314 acts as its own inventory. That is, it contains two 1s, three 2s, two 3s and one 4. Another example is 22 — it contains two 2s.

These numbers consist of alternating tallies and numerals. First comes the tally, then the numeral being tallied, then another tally, and so on.

How many numbers of this kind exist?

(Assume the numerals have to be tallied in increasing order, so you can’t create new numbers simply by rearranging: 21321423, for example, doesn’t count.)

Submit your answer

Riddler Classic

From Michael Kragh Pedersen, some shapely game theory:

You are playing a game against a single opponent. In front of you is an empty eight-by-eight grid and a pile of the 12 different pentominoes, one of each.

Taking turns, you and your opponent select a pentomino from the pile, rotate it however you like (but not flip it over) and place it anywhere within the grid. By rule, the pieces can’t overlap or extend outside the grid. The person to place the last possible piece wins.

Assume you go first. What is the optimal strategy? How does this game end with perfect play?

Submit your answer

Solution to last week’s Riddler Express

Congratulations to 👏 Ricki Heicklen 👏 of Teaneck, New Jersey, winner of last week’s Riddler Express!

Last week brought us to the virtual Wild West of the video game “Red Dead Redemption 2.” In that game, there is a quest where the main character is meant to collect 12 unique cigarette cards from each of 12 different sets. The easiest way to collect these cards is to buy packs of cigarettes from the general store at $5 a pop, each pack containing one random card from one of the sets. How much would we expect our main character to spend to complete all 12 sets?

It will cost nearly $4,000 — quite a lot in those days.

This is an example of the classic coupon collector’s problem. There are 144 different cards the character wants to collect, each of which he’ll have a 1/144 chance of receiving each time he buys a pack. So how long will this take? The main problem for this main character — and the problem we need to quantify — is that sometimes, or even oftentimes, he’ll buy a pack containing a card he already has. This becomes more and more likely the more cards he has collected.

Let’s go card by card. The first card will be collected in one purchase for sure — the character doesn’t have any cards yet and doesn’t care which one he gets. In his subsequent purchases, the second card will be collected with probability 143/144, the third card with probability 142/144, and so on. It gets less and less likely we get a new card the more cards we already have. Once we have all but one card, each purchase only gives us a 1/144 — or 0.7 percent — chance at completing our quest.

We can rewrite the expected number of purchases this will take as the following:

144 * (1/1 + 1/2 + 1/3 + … + 1/144)

That equals about 799.27 expected purchases to collect all 144 cards. At $5 a purchase, that’s about $3,996.

Collecting cigarette cards … in this economy?!

Solution to last week’s Riddler Classic

Congratulations to 👏 Michael Branicky 👏 of Lawrence, Kansas, winner of last week’s Riddler Classic!

Last week you were home alone playing a solitaire game of “Bananagrams.” You spread the game’s 144 lettered tiles on the table in front of you and wondered, “What grid of words can I create that uses all of these tiles in the fewest possible words?”

Wonder no longer: You can use them all in just nine words.

Solver Michael Branicky found the 13-word candidate solution pictured below — bonus points to Michael for the actual Bananagram tiles. It features the lovely, 28-letter ethylenediaminetetraacetates, a chemical apparently used to dissolve limescale.

Solver Laurent Lessard was able to do a bit better by modeling the puzzle as something called a mixed-integer program. He found the nine-word grid below. And, though this grid is not the only nine-word grid — at the very least, you can shift the words below around to overlap on different points — it is the one made with the fewest words possible. It features those classic pieces of kitchen-table “Bananagrams” vocabulary: keratoconjunctivitides, paraformaldehyde, magnetofluiddynamics and oxyphenbutazones. (Notably, “oxyphenbutazone” also features in the theoretically highest possible scoring “Scrabble” play.)

I also asked what completed grid used the most words. Michael is our winner for how he tackled that question, offering this grid that uses 109 words — many of which are those “Scrabble” classics re or od.

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]