What is the Average Number of Guesses in a Game with Varying Step Sizes?

  • Context: Graduate 
  • Thread starter Thread starter chingel
  • Start date Start date
  • Tags Tags
    Game
Click For Summary

Discussion Overview

The discussion revolves around the average number of guesses required to identify a number chosen from a large set, specifically when using different strategies for dividing the search space. Participants explore the implications of using various ratios for splitting the set and how these affect the average number of guesses needed, incorporating concepts from information theory.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant suggests that halving the range at each step leads to an average of approximately ##log_2(n)## guesses, while questioning the average number of guesses when using a 1/4 and 3/4 split.
  • Another participant introduces information theory, arguing that a 1/4 guess provides varying amounts of information depending on the outcome, leading to a complex relationship between the number of guesses and the information gained.
  • It is proposed that the average number of guesses with a 25/75 approach can be calculated as ##\frac{log_2 n}{0.915}## based on the information conveyed per guess.
  • A participant expresses interest in the information theory aspect and proposes a formula for the average number of guesses when dividing into m sets of proportions, suggesting it is ##\frac{-log(n)}{\sum a_i log(a_i)}##.
  • Another participant agrees with this formula and emphasizes the relationship between total information gained and average information per guess.
  • One participant notes that the logarithm of the length of the set decreases linearly and questions whether there is a proof for the intuitive understanding that the average number of steps relates to the total information divided by the average gained per step.

Areas of Agreement / Disagreement

Participants express varying viewpoints on the strategies for guessing and the application of information theory, with some agreeing on the formulas proposed while others raise questions about proofs and the implications of different approaches. No consensus is reached on the best method or the average number of guesses across all proposed strategies.

Contextual Notes

Participants acknowledge the complexity of the problem, particularly regarding the assumptions made about the ratios used for splitting the search space and the implications of information theory on the average number of guesses. There are unresolved questions about the proofs for the relationships discussed.

chingel
Messages
307
Reaction score
23
One number is chosen from 1 to n, n is large, and I want to guess that number. If I get to choose one number and then I'm told if the number is bigger or smaller, then the best strategy is to try to halve the range at every step and then the average number of guesses would be roughly ##log_2(n)##.

But what if instead of cutting the set in half at each step, I would always try to cut it in pieces of 1/4 and 3/4, how many steps on average would I take? And furthermore, if I cut it into m pieces of some fixed ratios at each step, how many steps on average would I take?

If I cut them into m equal pieces at every step, the average guesses is about ##log_m(n)##, but what about unequal pieces?

If it makes it easier to analyze, we can say that I don't pick numbers, I just split the sets and I get told in which set the number is and we can assume n is very large.
 
Physics news on Phys.org
Information Theory deals nicely with this sort of question. http://en.wikipedia.org/wiki/Information_theory

If you get lucky with your 1/4 guess, that yields as much information as two 50/50 questions would have yielded. So with 0.25 probability you get 2 bits of information. But if you get unlucky, you have only reduced the search space by 25 percent. That is less than what one 50/50 question would have yielded -- less than one bit of information.

How much less? Well, if you guessed unlucky twice in a row, that would reduce the search space to 0.75 * 0.75 = 0.5625 That's still not as much as a single bit of information. If you guessed badly three times, that would be reduce it by 0.75 * 0.75 * 0.75 = 0.421875. That's more than a single bit of information. So it takes somewhere between 2 and 3 unlucky guesses to equal one bit of information.

You can extend this and reason that the reduction in search space by a series of n unlucky guesses is ##0.75^n## while the reduction in search space by a series of m 50/50 guesses is ##0.50^m##. For the reductions to be equal then there would have to be a specific ratio between m and n -- each unlucky guess is worth ##-log_2 0.75## bits. Approximately 0.415. As expected, it takes between 2 and 3 such guesses to get a single bit of information.

The same formula works out for a lucky guess as well. The number of bits of information conveyed by a lucky guess is ##-log_2 0.25##. That's 2 bits.

This is the basis of Claude Shannon's measure of information. The information conveyed, on average, by each guess is taken as the sum over all possible outcomes of the probability of the outcome multiplied by the negative log of that same probability. In the 25/75 case, that is ##-0.25 log_2 0.25 + -0.75 log_2 0.75## which comes to about 0.915 bits per guess.

The information in the answer is the ##\frac{1}{n} log_2 \frac{1}{n}## added up over all n different possibilities for a total that is simply ##log_2 n##.

So the average number of guesses is ##\frac{log_2 n}{0.915}## with the 25/75 approach.
 
  • Like
Likes   Reactions: chingel
Thanks for the reply, the information theory seems to address exactly this sort of question. I haven't read about the theory before and it definitely is new and interesting, and I'll be reading more about it to get a better sense of why is information content the logarithm and why can we just take the average of the logarithms. There seems to be plenty of information on the internet about it, I'll start digging in.

I take it that for splicing it into m sets of proportions ##a_i## at every step, the average number of guesses will be ##\frac{-log(n)}{\sum a_i log(a_i)}##
 
I agree with that formula. Average number of guesses = total information gained divided by average information gained per guess.
 
A similar way is to notice that the logarithm of the length of the set decreases linearly. So we want to get a total of ##\log(n)##, step sizes are ##-\log(a_i)## with probability ##a_i##. It does make intuitive sense that the average number of steps for large n would be the total divided by the average gained on each step, but is there a proof for that?
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
4
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K