Roel Schroeven schreef: > [EMAIL PROTECTED] schreef: >> I had considered this, but to halve, you need to divide by 2. Using >> random, while potentially increasing the number of iterations, removes >> the dependency of language tricks and division. > > It's possible to use Fibonacci numbers instead of halving each time; > that requires only addition and subtraction. Unfortunately I forgot > exactly how that works, and I don't have the time to look it up or to > try to reproduce it now. Maybe later. > > AFAIK that method is not commonly used since binary computers are very > good at dividing numbers by two, but it would be a good method on > ternary or decimal computers.
Responding to myself since I found an explanation in the obvious place: http://en.wikipedia.org/wiki/Fibonacci_search_technique It is meant for search in ordered arrays though; I don't think it can be adapted for searching in mathematic intervals. -- If I have been able to see further, it was only because I stood on the shoulders of giants. -- Isaac Newton Roel Schroeven -- http://mail.python.org/mailman/listinfo/python-list