It is needed to guess number from 1 to 100. I can ask questions and get answers:"yes" or "no". For the "yes"-answer I must pay one dollar, for the "no"-answer - two dollars. How many dollars should I have to guess my number exactly?
The obvious decision is to product upper bound of $log_2 100$ on 2(we always divide our set on two equal parts and expect the worst case).
But I think that it is not an optimal algorithm, may be it is better to divide my set at an another ratio than one to one because of not equal costs of questions. May be at a ration two to one.
Help to find the best solution please. Thank you in advance.
A bit of formalisation, let's mark the questions by $A_{i}, 1\leq i\leq n$. Let's note $P(A_{i})=x_{i}$ - probability to get an "yes" for $A_{i}$. The mean is $1 \cdot x_{i} + 2 \cdot (1-x_{i})=2-x_{i}$. The total price is $2 \cdot n-\sum_{i=1}^{n}x_{i}$ - an optimisation problem of $x_{i}$ and $n$. Particularly, $x_{1}=x_{2}=...=x_{n}=x$, then the price is $n \cdot (2 - x)$.
By dividing the set (and subsequent sub-sets) in $M:K$ ratio, we have 2 extreme cases:
We end up with this "increase-reduce" $K$ and "increase-reduce" $M$ at the same time, which indicates (imho) 50:50 might be the best bet.