Bounded Binary Search
Consider the problem of determining a secret number from a set by repeatedly choosing a number and asking “Is the secret number greater than ?”.
If then no questions need to be asked. If then only one question needs to be asked. If then six questions need to be asked. However, in the latter case if the secret number is then six questions still need to be asked. We want to restrict the number of questions asked for small values.
Let be the least number of questions needed for a strategy that can find any secret number from the set where no more than questions are needed to find the secret value .
It can be proved that . You are also given and .
Find .
有界二分搜索
考虑如下问题:现需从集合中确定一个秘密数值,每次可以选择一个数,并询问“秘密数值是否大于?”。
如果,则无需提问。如果,则只需要问一个问题。如果,则需要问六个问题,但采取这种策略时,即使秘密数值是,也仍然需要问六个问题。相反,本题希望寻找一种尽可能减少秘密数值较小时所需提问数量的策略。
考虑所有从集合中找出任意秘密数值所需的问题数不超过的策略,记这种策略所需的最少提问次数为。
可以证明。已知,。
求。
Gitalking ...