Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Then you get uniform distribution problems. If I know the first few digits are 980 I can make a leap well to the back of the book. It really does become an interesting problem.

You can force it by not letting the person see the key, only the results of the comparison, but that is a little silly.

Maybe some of the mismatch comes from the human heuristic being so much faster than the physical turnpage-readname-compare operation. In a computer the compares are so fast that there isn't really a point to building a heuristic to optimize away the first few.

If the comparison finding were slow on a computer you would not use binary search, so in a sense you are forcing the human to use the wrong algorithm.



What you're describing is an interpolated binary search (where you don't divide in two, you pick a point based on a guesstimate of where the key will lie).

It turns out that interpolated binary searches are useful in computers, in cases where the structure being searched has a significant overhead for each read - for example, seeking in variable-bitrate-encoded video streams is such an application.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: