That’s a good one, for some priors about N. Any definition of “better” or “optimal” will be with respect to a prior about N. That prior can be unbounded and still produce good algorithms.
The obvious thing to tweak about your program is the “double N” constant; you could instead go to 3*N or something.
If you know your prior in detail, you’ll want to make your next guess to split the remaining probability weight evenly, not just the numeric search space. (Similar in concept to arithmetic coding.) With a poor understanding of the prior, though, this is a very minor detail.
That’s a good one, for some priors about N. Any definition of “better” or “optimal” will be with respect to a prior about N. That prior can be unbounded and still produce good algorithms.
The obvious thing to tweak about your program is the “double N” constant; you could instead go to 3*N or something.
If you know your prior in detail, you’ll want to make your next guess to split the remaining probability weight evenly, not just the numeric search space. (Similar in concept to arithmetic coding.) With a poor understanding of the prior, though, this is a very minor detail.