Jump to content
BrainDen.com - Brain Teasers
  • 0


bonanova
 Share

Question

You have nothing else to do so you write the numeral "1" on a ping pong ball.

You enjoy the experience so much that your write "2" on two other balls.

And "3" on three others, until you finally write "9" on nine more balls.

Let's see, that's 45 balls in nine groups, each the size of their written numbers.

Your friend offers to select one of them at random and let you guess its written

number by asking a sequence of yes-no questions. You find the game unchallenging.

Since 23 = 8 and 24 = 16 you can always guess the number in four tries - usually in three.

Your friend asks you if there isn't a guessing strategy that will reduce the average

number of questions needed determine the number on the selected ball?

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0
  On 8/15/2009 at 8:17 AM, bonanova said:

You have nothing else to do so you write the numeral "1" on a ping pong ball.

You enjoy the experience so much that your write "2" on two other balls.

And "3" on three others, until you finally write "9" on nine more balls.

Let's see, that's 45 balls in nine groups, each the size of their written numbers.

Your friend offers to select one of them at random and let you guess its written

number by asking a sequence of yes-no questions. You find the game unchallenging.

Since 23 = 8 and 24 = 16 you can always guess the number in four tries - usually in three.

Your friend asks you if there isn't a guessing strategy that will reduce the average

number of questions needed determine the number on the selected ball?

I got the following average number of questions, anyone got lower?

  Reveal hidden contents

3.044444 questions

Link to comment
Share on other sites

  • 0
  On 8/15/2009 at 8:51 AM, bushindo said:

I got the following average number of questions, anyone got lower?

  Reveal hidden contents

3.044444 questions

  Reveal hidden contents

I got 3.066666... questions (3/45 times you have to ask the fourth one)

Link to comment
Share on other sites

  • 0
  On 8/15/2009 at 4:24 PM, superprismatic said:

  Reveal hidden contents

136/45= 3.022222222 (Is it >7? , No: Is it >5?, No: Is it >3?, No: Is it 3?, No: Is it 2?)

  Reveal hidden contents

You have

17 ask 2, 13 ask 3, 9 ask 4, 3 ask 4, 3 ask 5

Yours has a maximum of 5 questions. I can give the same answer with a maximum of 4 questions:

Is it >= 7?

(yes) Is it 9? - 9/45 ask 2 to get 9

Is it 8? - 15/45 ask 3 to get 7 or 8

(no) Is it >= 5?

(yes) Is it 6? - 11/45 ask 3 to get 5 or 6

You have 1,2,3,4 left...

Is it >= 3?

Is it 4? - 7/45 ask 4 to get 3 or 4

Is it 2? - 3/45 ask 4 to get 1 or 2

So you have 9/45 asking 2, 26/45 ask 3, and 10/45 ask 4....136/45

Link to comment
Share on other sites

  • 0

  Reveal hidden contents

3.0

  Reveal hidden contents

...to divide 45 into successive number of equal parts and pick the balls that equal the sum..

In integer arithmetic,

45/2 = 22 (9+8+5)

(45 - 22)/2 = 11 (7+4)

(45 - 22 - 11)/2 = 6 (6)

..etc

Edited by methinks
Link to comment
Share on other sites

  • 0

Ugh finally remember weighted trees :duh:

  Reveal hidden contents

9*2 + 9*3 + 15*3 + 6*3 + 3*4 + 5*3

----------------------------------

45

Average of exactly 3 questions...

  Reveal hidden contents

Build a huffman tree:

Edit: add code block

Edited by tpaxatb
Link to comment
Share on other sites

  • 0
  On 8/17/2009 at 2:23 PM, tpaxatb said:
Ugh finally remember weighted trees :duh:

  Reveal hidden contents

9*2 + 9*3 + 15*3 + 6*3 + 3*4 + 5*3

----------------------------------

45

Average of exactly 3 questions...

  Reveal hidden contents

Build a huffman tree:


Is it 9,4,5?
Yes: Is it 9?
Yes: 2 questions to get 9
No: Is it 5?
3 questions to get 4 and 5
No: Is it 8 or 7?
Yes: Is it 8?
3 questions to get 7 and 8
No: Is it 6?
Yes: 3 questions to get 6
No: Is it 3?
Yes: 4 questions to get 3
No: Is it 2?
5 questions to get 1 or 2

Edit: add code block

Bingo! B))

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...