A lesson from Essential Calculus for ML
£29/month
£29/month£29/month or £249/year · 30-day money-back guarantee
Get full accessOur content is best on a larger screen
What convex means
A graph that is concave up, such as the graph of , bends upwards: it lies above each of its tangent lines. Now join two points of the graph with a secant line instead. Because the graph bends upwards, it sags below the secant line between those two points, and the same happens for every pair of points we choose.
A function with this property is called convex: it is the same bending, described with secant lines rather than tangent lines. For a differentiable function, convex means exactly the same as concave up. A secant line needs no derivative, though, so convexity also makes sense for graphs with corners, such as , where there is no tangent line.
To make this precise, we compare the graph's height with the secant line's height above each point between two inputs and .
Definition
A function whose domain is an interval is convex if, for all and in the domain and every in ,
The first diagram below builds this up step by step. The second shows a function that is not convex: drag its endpoints to find a secant line that the graph rises above.
Take two inputs
Key Point
One choice of , and where the graph rises above the secant line shows that is not convex. Choices where it does not, however many, prove nothing.
Practice questions
5 questions
The graph of , which is for and for , with domain is shown below.
Is convex?
Select the correct answer:
+ 4 more questions · unlocked with a subscription
Convexity in two variables
Convexity for a function on the whole plane is the same idea as in one variable. The two inputs are now points and of the plane rather than numbers and , and the graph is a surface, but we still compare it with a secant line: the straight line joining the two points of the surface above and .
Definition
A function on the whole plane is convex if, for all points and and every in ,
For and , the point between them puts the same weights, and , on each coordinate:
The first diagram below builds this comparison step by step. The second shows a function that is not convex.
The surface
Drag the scene to rotate it.
As in one variable, one choice of , and where the inequality fails shows that is not convex; choices where it holds, however many, prove nothing. Showing that a function of two variables is convex takes a general test, which we meet in a later lesson.
Show that on the whole plane is not convex, using , and .
Solution
With , the weights are on and on , so the point between them is
We evaluate at , at and at :
We find the secant line's height above with the same weights, now on and :
We compare the two heights:
The surface rises above the secant line here, so the inequality fails for this choice of , and . Therefore is not convex.
Practice questions
4 questions
Take on the whole plane, , and . Which statement is correct?
Select the correct answer:
+ 3 more questions · unlocked with a subscription
Every time you pull an answer from memory, the memory gets stronger. Reading doesn't do that. Nodeledge asks you questions on every step of every lesson, then asks again after days, weeks and months.