Get all your news in one place.
100’s of premium titles.
One app.
Start reading
The Guardian - UK
The Guardian - UK
Science
Alex Bellos

Can you solve it? Think of a number

Science presenter Johnny Ball in 1989.
Science presenter Johnny Ball in 1989. Photograph: ITV/REX

“Think of a number” tricks are such a puzzle staple that the BBC even named a kids show after them. (To readers under the age of 40, Think of a Number was hosted by Zoe Ball’s dad Johnny, and to many Britons, this one included, it was an indelible cultural highlight of growing up in the late 1970s/early 1980s.)

The following puzzle is a brilliant version of a ‘think of a number’ type problem, which I had not seen until recently. The solution is wonderfully ingenious. If you don’t crack it now, or at all (as it consumes your day, sorry), you will be rewarded when I reveal the answer at 5pm.

Ask Johnny

Johnny thinks of a number between 1 and 1,000 inclusive. Your job is ask him questions to discover what that number is.

Johnny will always be truthful, to the best of his knowledge, but is only allowed to reply either “Yes”, “No” or “I don’t know.”

What is the fewest number of questions you need to ask Johnny in order to guarantee you will discover his number?

Here’s one method, perhaps the most obvious, of how your interrogation (integer-ogation?) might go. Start by asking him if his number is between 1 and 500 inclusive. Once he replies, the candidates for the number will have been reduced by half. Continue in this way, each time dividing the set of remaining numbers into two equal halves. For example, just say Johnny thought of 358, your questions (and his answers, in bold) would go something like:

Is the number between

  • 1 and 500? Yes.

  • 1 and 250? No.

  • 251 and 375? Yes.

  • 251 and 313? No.

  • 314 and 345? No.

  • 346 and 361? Yes.

  • 346 and 354? No

  • 355 and 358? Yes

  • 355 and 356? No

  • Is it 358? Yes! (a No here gets you the answer too.)

By doing it this way you are guaranteed to discover the number in 10 questions.

Yet it is possible to discover it with fewer. How?

NO SPOILERS

Instead discuss your favourite ‘think of a number’ puzzles or tricks.

I’ll be back at 5pm UK with the solution.

UPDATE: Read the solution here.

I set a puzzle here every two weeks on a Monday. I’m always on the look-out for great puzzles. If you would like to suggest one, email me.

I’m the author of several books of puzzles, most recently the Language Lover’s Puzzle Book.

Today’s puzzle is adapted from The Bogotá Puzzles by Bernardo Recamán. Bernardo is a Colombian mathematician and the inventor of the Slightly Spooky Recamán Sequence.

Sign up to read this article
Read news from 100’s of titles, curated specifically for you.
Already a member? Sign in here
Related Stories
Top stories on inkl right now
One subscription that gives you access to news from hundreds of sites
Already a member? Sign in here
Our Picks
Fourteen days free
Download the app
One app. One membership.
100+ trusted global sources.