Jump to content
BrainDen.com - Brain Teasers
  • 0


Gmaster479
 Share

Question

I just downloaded an application called 'Guess My Age' onto my ipod touch and found it to be surprisingly accurate and wanted to find out why. What the application does is that it shows you 50 numbers on a page and you say whether your age is on that page. You touch 'yes' or 'no' and it happens 7 times. After that you will get how old you are. It is correct for any number 0-99 so with this I give you 3 questions

1. With a limit of 7 pages and Yes or no answers, up to how many numbers could be deduced with 100% accuracy?

2. Give a sample of what 50 numbers you would put on each page so that you could deduce someone's age (assuming it's 0-99 as in the actual app). Is there more than one way to do it?

3. If you are told to make an app similar to this only making it possible to deduce any number 1-200, what is the least amount of pages you could do it in (assuming you can put as many numbers on a page as you want)

NOTE: Do not download the app to get the answers. That would be cheating ;)

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

I just downloaded an application called 'Guess My Age' onto my ipod touch and found it to be surprisingly accurate and wanted to find out why. What the application does is that it shows you 50 numbers on a page and you say whether your age is on that page. You touch 'yes' or 'no' and it happens 7 times. After that you will get how old you are. It is correct for any number 0-99 so with this I give you 3 questions

1. With a limit of 7 pages and Yes or no answers, up to how many numbers could be deduced with 100% accuracy?

2. Give a sample of what 50 numbers you would put on each page so that you could deduce someone's age (assuming it's 0-99 as in the actual app). Is there more than one way to do it?

3. If you are told to make an app similar to this only making it possible to deduce any number 1-200, what is the least amount of pages you could do it in (assuming you can put as many numbers on a page as you want)

NOTE: Do not download the app to get the answers. That would be cheating ;)

Link to comment
Share on other sites

  • 0

It should take 8 calculations to approximate a number between 1-200. And no, I didn't down load the app.

Edited by bonanova
Spoiler added.
Link to comment
Share on other sites

  • 0

The algorithm just splits the population (number of possible correct ages)in half each time.

1st time it narrows the possibilities down to 50 numbers

2nd time down to 25

3rd time down to 13

4th time down to 7

5th time down to 4

6th time down to 2

7th time down to 1 (Your age)

Link to comment
Share on other sites

  • 0

1. 128

2. start with 0-49. Half the interval each time (e.g 0-49,0-24,0-12,0-6,0-3,0-1), filling the rest of the 50 numbers with ages you've already eliminated.

3. 8

Link to comment
Share on other sites

  • 0

Each page contains exactly half of all possible numbers.

But it is simpler than binary search. It is a matter of constructing the pages correctly.

Number each page sequentially starting with zero.

Associate with each page a value equal to 2 raised to the page number.

Page 0 -> 1, page 1 -> 2, page 2 -> 4, page 3 -> 8, page 4 -> 16, etc.

Now place on each page all numbers which, when represented in binary, have that bit set.

Page 0 contains all odd numbers.

Page 1 contains 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31, etc.

Page 2 contains 4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31, etc

Page 3 contains 8, 9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31, etc.

Page 4 contains 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, etc.

When the user selects whether or not their number is on a page,

they are turning on / off the corresponding bit in the answer.

If there are 7 pages, the answer can be from 00000000 to 01111111 (binary) which is 127 (base 10).

If there are 8 pages, the answer can be from 00000000 to 11111111 (binary) which is 255 (base 10).

This is the most efficient method of reconstructing the answer.

Let the user do it for you!

Edited by Kerrik
Link to comment
Share on other sites

  • 0

1. 128

2. start with 0-49. Half the interval each time (e.g 0-49,0-24,0-12,0-6,0-3,0-1), filling the rest of the 50 numbers with ages you've already eliminated.

3. 8

Correct on almost all accounts psychicmind.

it's 127 because it's impossible to have one number on every page. The basic formula (as Kerrik explained below) is

2n- 1 with n equaling the number of pages.

Very good

Just out of curiosity, isn't the quote, "It is better to remain silent and be thought a fool, than to..."?

Not the way I know it, but i guess it means the same thing that way as well.

Each page contains exactly half of all possible numbers.

But it is simpler than binary search. It is a matter of constructing the pages correctly.

Number each page sequentially starting with zero.

Associate with each page a value equal to 2 raised to the page number.

Page 0 -> 1, page 1 -> 2, page 2 -> 4, page 3 -> 8, page 4 -> 16, etc.

Now place on each page all numbers which, when represented in binary, have that bit set.

Page 0 contains all odd numbers.

Page 1 contains 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31, etc.

Page 2 contains 4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31, etc

Page 3 contains 8, 9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31, etc.

Page 4 contains 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, etc.

When the user selects whether or not their number is on a page,

they are turning on / off the corresponding bit in the answer.

If there are 7 pages, the answer can be from 00000000 to 01111111 (binary) which is 127 (base 10).

If there are 8 pages, the answer can be from 00000000 to 11111111 (binary) which is 255 (base 10).

This is the most efficient method of reconstructing the answer.

Let the user do it for you!

Very good answers for all of them Kerrik. You might as well have written out the application for Apple :thumbsup:

Edited by Gmaster479
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.

Loading...
 Share

  • Recently Browsing   0 members

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