Goldilocks Numbers

Goldilocks Numbers

By Stephen Meskin

A Goldilocks number is a number that is not too hard and not too easy: It is just right. Have you ever tried to log into a somewhat sensitive website such as a bank, credit card account, etc., and the site owner wants to make sure you are you? So, they send you a number, which you need to send back to them. I went through a period in which I had to do it frequently in a short period of time. It started me thinking about how those numbers were chosen.

I quickly decided that they wouldn’t be chosen randomly in accordance with a uniform distribution, because in that case, one is likely to get 000000 or 112212, which are too easy. On the other hand, the customer may not be able to cut and paste the number, so it might be good customer relations not to make the number too hard—such as 475192 or 051619. Six digits seems about right, but that raises the question of whether there are enough 6-digit Goldilocks numbers. In fact, that is the

Problem: How many 6-digit numbers are a) too easy, b) too hard, or c) just right?

As a first approximation, we’ll say that a 6-digit number is too easy if among the 6 digits there are no more than 2 distinct digits. And we’ll say that it is too hard if there are 5 or 6 distinct digits among the 6. (In this problem a 6-digit number can have leading zeros.)


Solutions may be emailed to puzzles@actuary.org.
In order to make the solver list, your solutions must be received by February 1, 2024.

Solution to Previous Puzzle: Radio Contests—Part 2

If you have 5 guesses at a random number between 1 and 550, and you know after each guess if the correct answer is higher or lower, what is the probability of you getting the right number before your guesses run out? If one picks 275 for the first guess, one of two things will happen: One, the contestant has a 1 in 550 chance of guessing the lucky number. Or two, the contestant will know not only that 275 is wrong but that the lucky number is either between 1 and 274 or 276 and 550. If the number is between 1 and 274, you again guess the midpoint (now with a 1-in-274 chance of finding the lucky number)—138—and repeat the process three more times if you don’t guess the right number. After five guesses, the contestant has a 5.6% chance of winning.

If the radio station wants the contest to go on as long as possible, what number should the radio station pick? Let’s create a 55-cell-by-55-cell matrix, where the rows are the original guess, and the    columns are the actual lucky number. Each cell is equally likely, and we want to determine the average number of guesses it would take to find the luck number in each cell. Fortunately, this isn’t as cumbersome as it seems due to the recursive nature of the problem. Specifically, if your first guess is 17, if the actual number is 17, you are right after one guess. If the actual number is less than 17, no matter what the lucky number is, your probability of getting the lucky number is now if are playing the guessing game with 16 possibilities instead of 55. Similarly, if the lucky number is greater than 17, your new probability of getting the lucky number is if you played the game with 38 choices instead of 55. We can use this information, work backward, and use a little elbow-grease to find the average number of guesses it takes for each cell. After doing this, we just need to see which column has the highest average number of correct guesses. This turns out to be where the lucky number is 28, which has an average of just over 6.85 guesses to find the lucky number.

If the radio station wants the contest to end as soon as possible, what number should it pick? Using the same matrix we created in part 3, we can see the columns where the lucky number is 1 or 55 both have the lowest number of expected guesses, where it will take on average just over 4.59 guesses to find the correct number. Notice the radio station can shorten the contest by over 30% just by strategically picking lucky numbers close to the endpoints!


Bob Conger, Rui Gio, Ryan Jubber, Clive Keating, Chi Kwok, David Promislow, Tomasz Serbinowski, and Al Spooner.

Next article Blue Dot
Previous article Editors—Friend or Foe?

Related posts