Number of local minimums and nonconvexity I came across the following in my reading, and I like to know why this is true. 
"$\dots$ but, the fuction $F:\mathbb{R}^n \to \mathbb {R}$ is nonconvex since it has several local minima $\dots$"
What does the number of local minima have to do with convexity?
 A: It's actually possible for a convex function to have multiple local minima, but the set of local minima must in that case form a convex set, and they must all have the same value. So, for instance, the convex function $f(x)=\max\{\|x\|-1,0\}$ has a minimum of $0$ for all $\|x\|\leq 1$. (In one dimension, a convex set is just an interval.)
In particular, what is not possible is for a convex function to have multiple disjoint local minima. For instance, the nonconvex function $f(x)=(x^2-1)^2$ obtains a minimum of $0$ when $x=\pm 1$.
Consider also the nonconvex function in $\mathbb{R}^n$, $f(x)=(\|x\|^2-1)^2$. This function obtains a minimum of $0$ when $\|x\|=1$, the unit ball. This optimal set is connected when $n\geq 2$, but not convex.
Of course, a convex function need not have a minimum at all; for instance $f(x)=e^x$. But if a convex function has a local minimum, it is a global minimum, and this and all other points that achieve this same value form a convex set.
A: Indeed a convex function can only have one local max (which is therefore a global max).  Think about this in the case $n=1$.  Draw a smooth function with two local maxima and you'll see there has to be an inflection point where it goes from convex to concave.
