What are some simple algorithms that find the maximum of a function in a certain domain?

The function $f$ is guaranteed to have 1 maximum and no other turning points between $a$ and $b$, how can I find out what the value of this maximum is without knowing anything about the function? I can only query what $f(x)$ is for some $x$. How can I eventually approximate the $x$ for which the function has its maximum?

  • $\begingroup$ Do you know the order of the curve ? $\endgroup$
    – t123
    Nov 27, 2017 at 19:10
  • $\begingroup$ @t123 all I can do is query what $f(x)$ is for a certain $x$. It could be anything, not necessarily a polynomial. $\endgroup$ Nov 27, 2017 at 19:15
  • $\begingroup$ What do you mean by "no turning points"? Do you mean it is increasing, then decreasing? If so, try a variant on binary search. $\endgroup$
    – D.W.
    Nov 27, 2017 at 19:49
  • $\begingroup$ @D.W. at the moment I'm thinking that I take the midpoint between the two highest values found so far $\endgroup$ Nov 27, 2017 at 19:56
  • $\begingroup$ Still not clear what you mean by "no turning points", so it's hard to know how to answer your question. $\endgroup$
    – D.W.
    Nov 27, 2017 at 20:43


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.