How to Check if a Set is Convex?

3.9k Views Asked by At

I am wondering to practically check the convexity of a set. I understood the definition but, in practice, how can we check the convexity of a set, especially if it is defined in higher spaces.

If you can show me, maybe solving these two examples, I'll appreciate your help!

Examples

1

There are 1 best solutions below

2
On BEST ANSWER

The first one is convex because for any two pints in it the entire line segment from one to the other is in it. The second one is not convex: $(0,n)$ and $(n,0)$ belong to it but $\frac 1 2 (n,0)+\frac 1 2 (0,n)$ does not if $n >2$.

For the first set you can also use triangle inequality for the usual norm on $\mathbb R^{2}$.