thomblake comments on From the "weird math questions" department... - Less Wrong

5 Post author: CronoDAS 09 August 2012 07:19AM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (49)

You are viewing a single comment's thread. Show more comments above.

Comment author: thomblake 10 August 2012 01:44:19PM 0 points [-]

a binary search (modified for infinite lists)

By the way, one way of doing this is:

  1. Make your best guess for N and check it.
  2. If the test comes out "fake", perform a binary search from 1 (or the highest known "true" value) to N
  3. If the test comes out "true", double N and goto 1.

I don't think there's an optimal search algorithm for an infinite list of unknown distribution. Anyone know better?

Comment author: evand 11 August 2012 03:11:20AM 0 points [-]

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.