I have recently encountered one programming problem which was reduced to find minimum value of function.Function f was sum of two functions f1 and f2 and f1 is strictly increasing and f2 is strictly decreasing. How can I prove that f1+f2 is unimodal from given information? I tried to think intuitively by considering slopes of f1 and f2 but I am not able to prove above fact. Can anyone give some approach or explanation? Thanks.
-
1Do you mean one was increasing and one was decreasing? If they are both increasing, so is the sum, so the maximum comes at the top end of the allowable interval. – Ross Millikan Jan 08 '19 at 17:44
-
edited. Thanks for pointing out – Patel Parth Jan 08 '19 at 17:49
-
I don't think this is true. It's easy to construct a counter-example, using piecewise linear functions. – verret Jan 08 '19 at 20:25
2 Answers
You can't prove it because it isn't true. $f1$ could increase rapidly for a while as $f2$ is slowly decreasing, leading the sum to increase, then $f2$ could decrease rapidly for a while while $f1$ is slowly increasing, making the sum decrease. Repeat this and you can have as many peaks in the sum as you want. An example is below. $f1$ is in blue, $f2$ is in red, $f1+f2$ is in yellow and is bimodal
- 374,822
If $f_1$ is an increasing and $f_2$ is decreasing it is not necessarily true that $g(x):= f_1(x) + f_2(x)$ is unimodal. Consider the following example: $f_1(x) = x$ when $x<1$, $f(x) = 4x$ when $x\geq 1$, and $f_2(x) = -x^2$. Then $g(x)=x-x^2$ when $x<1$ and $g(x) = 4x-x^2$ when $x\geq 1$. The function $g(x)$ has two local maxima at $(1/2,1/4)$ and $(2, 4)$.
- 1,915
