Linear functions¶
Part 1 · Linear functions, polyhedra and linear programming problems · Chapter 1 · Lecture notes, volume 1 (PDF) · App: Level lines
1.1 Linear functions¶
Definition 1.1: linear function
Given a (column) vector
the associated (scalar) function
is called a linear function.
Definition 1.2: gradient of a linear function
The gradient (vector of the partial derivatives) of the linear function \(f({\boldsymbol x}) = {\boldsymbol c}'{\boldsymbol x}\) is:
Definition 1.3: Hessian of a linear function
The Hessian (matrix of the second partial derivatives) of the linear function \(f({\boldsymbol x}) = {\boldsymbol c}'{\boldsymbol x}\) is the \(n \times n\) matrix:
since every first partial derivative \(\frac{\partial f({\boldsymbol x})}{\partial x_j} = c_j\) is a constant.
Definition 1.4: level sets of a linear function
The level sets of the linear function \(f({\boldsymbol x}) = {\boldsymbol c}'{\boldsymbol x}\) (the sets of points in which the function is constant) are:
-
The gradient of a linear function is the same vector \({\boldsymbol c}\) at every point and, accordingly, its Hessian (matrix of the second partial derivatives) is the zero matrix everywhere.
-
The level sets of a linear function are the hyperplanes perpendicular to the gradient.
Example 1.1: gradient and level sets of linear functions
With \({\boldsymbol c}=\begin{pmatrix} 8\\ 4 \end{pmatrix}\), the associated linear function is:
Gradient:
The figure shows:
-
The gradient evaluated at \(\begin{pmatrix} 0 \\ 0 \end{pmatrix}\): \(\nabla f\left(\begin{pmatrix} 0 \\ 0 \end{pmatrix}\right) =\begin{pmatrix} 8 \\[0.5ex] 4 \end{pmatrix}\) (blue arrow)
-
Two level sets (blue dashed lines): \(8 x_1 +4 x_2 = 16\) and \(8 x_1 +4 x_2 = 40\)
Example 1.2: gradient and level sets of linear functions
With \({\boldsymbol c}=\begin{pmatrix} -8\\ -4 \end{pmatrix}\), the associated linear function is:
Gradient:
The figure shows:
-
The gradient evaluated at \(\begin{pmatrix} 0 \\ 0 \end{pmatrix}\): \(\nabla f\left(\begin{pmatrix} 0 \\ 0 \end{pmatrix}\right) =\begin{pmatrix} -8 \\[0.5ex] -4 \end{pmatrix}\) (blue arrow)
-
Two level sets (blue dashed lines): \(-8 x_1 -4 x_2 = 16\) and \(-8 x_1 -4 x_2 = 40\)
Example 1.3: graphs of linear functions
With \({\boldsymbol c}=\begin{pmatrix} 8\\ 4 \end{pmatrix}\), we have \(f\left(\begin{pmatrix} x_1 \\ x_2 \\ \end{pmatrix}\right)=8\;x_1 + 4\;x_2\). Its graph is:
Example 1.4: graphs of linear functions
With \({\boldsymbol c}=\begin{pmatrix} -8\\ -4 \end{pmatrix}\), we have \(f\left(\begin{pmatrix} x_1 \\ x_2 \\ \end{pmatrix}\right)=-8\;x_1- 4\;x_2\). Its graph is:
Interactive lab¶
The ideas of the chapter, hands on: move the sliders and drag the points. Each app also opens full page in the interactive lab: Level lines.