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!

## 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}$.