in reply to Re^2: Updates to a guessing number script
in thread Updates to a guessing number script
Without re-reading my post, I believe I was talking about the Binary Search in general -- that it can reduce a trillion-item problem to 40 "guesses", where guess really should have been written as 40 well-chosen queries.
But you are correct, and your post is well thought-out. If the person trying to guess the number picks a number at random, then another number at random within the newly discovered valid range, and so on, he would be able to narrow the problem area much faster than doing a linear search.
And it seems we agree that the optimal solution (excluding approaches involving human frailty or psychology), will still be a binary search. The "random guess" method for dividing and conquering is not totally dissimilar from a binary search; it's just not as well disciplined in perfectly bisecting the remaining problem area. Nevertheless, it still manages to divide and conquer, like Binary Search does.
Your post is good; it adds real-world practicality to the discussion.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Updates to a guessing number script
by Laurent_R (Canon) on Mar 02, 2014 at 11:13 UTC |