A convex and a non-convex set

The intuitive idea of a convex set is best given by a picture.

alt text 

A convex set in mathbf{R}^2. For any two pair of points, such as x_1 and x_2, the line segment joining the two points is entirely in the set. Note that if the two points are chosen to be those indicated in red, the line segment is at the boundary in this case — but that is OK, provided the set is closed (it contains its boundary).

alt text 

Non-convex sets may contain points such as x_1 and x_2, with the line segment that joins them not entirely included in the set.