I was going through the Golden Section Search https://en.wikipedia.org/wiki/Golden_section_search and as I understand it should work for every unimodal function. Here, the definition of unimodal function that I use is the following:
- A function $f: \mathbb{R}\rightarrow \mathbb{R}$ is called unimodal if it has a single point of minimum(maximum) $x_0$ and $f(x)$ is monotonically decreasing for all $x\leq x_0$ and it is monotonically increasing for all $x\geq x_0$.
Now, I was wondering if it would work if the function $f$ is weakly unimodal. In other words, if we exchange decreasing and increasing in the definition with non-increasing and non-decreasing respectively.
My intuition is that it will not because we might have some kind of flat function (straight line) and if this happens at the minimum then we might have an infinite number of minimum points. However, I am not sure how to formulate such a function, any ideas?
Thanks in advance.
Hint: What interval does the algorithm throw out if the two inner function evaluations are the same $f(x_4)= f(x_3)$ with $x_3, x_4 \in [x_1,x_2]$ Where the interval $[x_1, x_2]$ contain the minimum.
Is it allowed yes/no to throw out this interval if the function is weakly unimodular(does the new interval always still contain the minimum) ?