Skip to main content

Section 6.6 Applications to Linear Models

Handout 6.6 Applications to Linear Models

Β 
One of the most useful applications of finding least squares solutions is to determine curves of best fit for data.
A graph containing four points and the line of best fit.
The graph above gives an approximate linear relationship between \(x\) and \(y\text{.}\)
  • The black circles are data.
  • The blue line is the least squares line, also known as the line of best fit.
  • The lengths of the red lines are the errors between our line of best fit and the data.
  • The least squares line minimizes the sum of squares of the errors.

Example 6.60.

Suppose we want to construct a line of the form \(y=mx+b\) that best fits the data below.
A 2D scatter plot showing the four points (-2,0), (-1,2), and (3,3) used for linear least squares fitting.

(a)

Find a system of equations \(A\vec x = \vec b\) that can be used to solve for \(m\) and \(b\text{.}\)
Solution.
Note that we want the line to go through the points \((-2,0), (-1,2),\) and \((3,3)\text{.}\) Each of these points gives an equation in terms of \(m\) and \(b\) which is found by plugging the point in for \(x\) and \(y\) in the model \(y = mx+b\text{.}\) We have
\begin{alignat*}{2} (-2,0) \amp \rightarrow 0 = m(-2) + b \amp \implies -2m + b = 0\\ (-1,2) \amp \rightarrow 2 = m(-1) + b \amp \implies \phantom{.}-m + b = 2\\ (3,3) \amp \rightarrow 3 = m(3)\phantom{-} + b \amp \implies \phantom{-}3m + b = 3 \end{alignat*}
Therefore, the system which should be solved to determine \(m\) and \(b\) is
\begin{equation*} \begin{bmatrix}-2 \amp 1 \\ -1 \amp 1 \\ 3 \amp 1 \end{bmatrix}\begin{bmatrix} m \\ b \end{bmatrix} = \begin{bmatrix} 0 \\ 2 \\ 3 \end{bmatrix}\text{.} \end{equation*}

(b)

Is the system found in (a) consistent?
Solution.
Note that
\begin{equation*} \begin{bmatrix}-2 \amp 1 \amp \rvert \amp 0 \\ -1 \amp 1 \amp \rvert \amp 2 \\ 3 \amp 1 \amp \rvert \amp 3 \end{bmatrix} \sim \begin{bmatrix} 1 \amp -1 \amp \rvert \amp -2 \\ 0 \amp -1 \amp \rvert \amp -4 \\ 0 \amp 4 \amp \rvert \amp 9 \end{bmatrix} \sim \begin{bmatrix} 1 \amp -1 \amp \rvert \amp -2 \\ 0 \amp 1 \amp \rvert \amp 4 \\ 0 \amp 0 \amp \rvert \amp -7 \end{bmatrix}\text{,} \end{equation*}
which is an inconsistent system.

(c)

Identify the best choices of \(m\) and \(b\) by finding the least-squares solution to \(A\vec x = \vec b\text{.}\)
Solution.
We start with the normal equations \(A^TA\vec x = A^T\vec b\text{.}\) Note that
\begin{equation*} A^TA = \begin{bmatrix} -2 \amp -1 \amp 3 \\ 1 \amp 1 \amp 1 \end{bmatrix} \begin{bmatrix} -2 \amp 1 \\ -1 \amp 1 \\ 3 \amp 1 \end{bmatrix} = \begin{bmatrix} 14 \amp 0 \\ 0 \amp 3 \end{bmatrix} \end{equation*}
and
\begin{equation*} A^T\vec b = \begin{bmatrix} -2 \amp -1 \amp 3 \\ 1 \amp 1 \amp 1 \end{bmatrix} \begin{bmatrix} 0 \\ 2 \\ 3 \end{bmatrix} = \begin{bmatrix} 7 \\ 5 \end{bmatrix}\text{.} \end{equation*}
Therefore, to find the least-squares solution, we solve the system
\begin{equation*} \begin{bmatrix} 14 \amp 0 \\ 0 \amp 3 \end{bmatrix} \begin{bmatrix} m \\ b \end{bmatrix} = \begin{bmatrix} 7 \\ 5 \end{bmatrix}\text{.} \end{equation*}
Note that
\begin{equation*} \begin{bmatrix} 14 \amp 0 \amp \rvert \amp 7 \\ 0 \amp 3 \amp \rvert \amp 5 \end{bmatrix} \sim \begin{bmatrix} 1 \amp 0 \amp \rvert \amp \frac{1}{2} \\ 0 \amp 1 \amp \rvert \amp \frac{5}{3}\end{bmatrix}\text{.} \end{equation*}
Thus, the line of best fit is
\begin{equation*} y = \frac{1}{2}x + \frac{5}{3}\text{.} \end{equation*}
We can use this technique to find line of best fit even when there are more than two variables.

Example 6.61.

Suppose we are trying to predict house prices based on two factors:
We have the following data:
Table 6.62. Housing Data
Size (in 1000 sq ft) Number of Bedrooms Price (in $1000s)
1.0 1 180
2.0 2 260
3.0 3 310
4.0 3 350

(a)

Setup the least-squares problem which will produce the best linear model for this situation:
\begin{equation*} y = \beta_0 + \beta_1 x_1 + \beta_2 x_2\text{.} \end{equation*}
Solution.
The data gives the following data points \((x_1, x_2, y)\text{:}\)
\begin{equation*} (1, 1, 180), (2,2, 260), (3,3,310), (4,3,350)\text{.} \end{equation*}
Like in the previous example, each data point gives an equation:
\begin{alignat*}{2} (1,1,180) \amp \rightarrow 180 = \beta_0 + \beta_1(1) + \beta_2(1) \amp \implies \beta_0 + \phantom{2}\beta_1 + \phantom{3}\beta_2 = 180\\ (2,2,260) \amp \rightarrow 260 = \beta_0 + \beta_1(2) + \beta_2(2) \amp \implies \beta_0 + 2\beta_1 + 2\beta_2 = 260\\ (3,3,310) \amp \rightarrow 310 = \beta_0 + \beta_1(3) + \beta_2(3) \amp \implies \beta_0 + 3\beta_1 + 3\beta_2 = 310\\ (4,3,350) \amp \rightarrow 350 = \beta_0 + \beta_1(4) + \beta_2(3) \amp \implies \beta_0 + 4\beta_1 + 3\beta_2 = 350 \end{alignat*}
It follows that the system of the form \(A\vec x = \vec b\) which would lead to an exact fitting of the curve is
\begin{equation*} \begin{bmatrix} 1 \amp 1 \amp 1 \\ 1 \amp 2 \amp 2 \\ 1 \amp 3 \amp 3 \\ 1 \amp 4 \amp 3 \end{bmatrix} \begin{bmatrix} \beta_0 \\ \beta_1 \\ \beta_2 \end{bmatrix} = \begin{bmatrix} 180 \\ 260 \\ 310 \\ 350 \end{bmatrix}\text{.} \end{equation*}
This system is not consistent (feel free to check). Therefore, we instead find the normal equations in order to find the least-squares solution. Note that
\begin{equation*} A^TA = \begin{bmatrix} 1 \amp 1 \amp 1 \amp 1 \\ 1 \amp 2 \amp 3 \amp 4 \\ 1 \amp 2 \amp 3 \amp 3 \end{bmatrix}\begin{bmatrix} 1 \amp 1 \amp 1 \\ 1 \amp 2 \amp 2 \\ 1 \amp 3 \amp 3 \\ 1 \amp 4 \amp 3 \end{bmatrix} = \begin{bmatrix} 4 \amp 10 \amp 9 \\ 10 \amp 30 \amp 26 \\ 9 \amp 26 \amp 23 \end{bmatrix} \end{equation*}
and
\begin{equation*} A^T\vec b = \begin{bmatrix} 1 \amp 1 \amp 1 \amp 1 \\ 1 \amp 2 \amp 3 \amp 4 \\ 1 \amp 2 \amp 3 \amp 3 \end{bmatrix}\begin{bmatrix} 180 \\ 260 \\ 310 \\ 350 \end{bmatrix} = \begin{bmatrix} 1100 \\ 3030 \\ 2680 \end{bmatrix}\text{.} \end{equation*}
Therefore, the system which leads to our least-squares solution is
\begin{equation*} \begin{bmatrix} 4 \amp 10 \amp 9 \\ 10 \amp 30 \amp 26 \\ 9 \amp 26 \amp 23 \end{bmatrix}\begin{bmatrix} \beta_0 \\ \beta_1 \\ \beta_2 \end{bmatrix} = \begin{bmatrix} 1100 \\ 3030 \\ 2680 \end{bmatrix}\text{.} \end{equation*}

(b)

Solving the system above, we find that
\begin{equation*} \widehat \beta = \begin{bmatrix} \beta_0 \\ \beta_1 \\ \beta_2 \end{bmatrix} = \begin{bmatrix} 120 \\ 35 \\ 30\end{bmatrix}\text{.} \end{equation*}
According to this model, how much should a house with 2000 ft\(^2\) and 3 bedrooms be worth?
Solution.
We find that the linear model that best fits the data is
\begin{equation*} y = 120 + 35x_1 + 30x_2\text{.} \end{equation*}
Note that 2000 ft\(^2\) corresponds to \(x_1 = 2\) and 3 bedrooms corresponds to \(x_2 = 3\text{.}\) Plugging this into the model, we find that
\begin{equation*} y = 120 + 35(2) + 30(3) = 120 + 70 + 90 = 280\text{.} \end{equation*}
Therefore, a house with 2000 ft\(^2\) and 3 bedrooms should be worth $280,000.
We do not have to restrict ourselves to linear curves of best fit. All that is required to use Least Squares is that the unknowns we are trying to solve for, our coefficients, are linear. There is nothing wrong with allowing the variables to be nonlinear.
In general, we can consider least squares fitting for the form
\begin{equation*} y = \beta_0 + \beta_1 f_1(x_1, \dots, x_m) + \beta_2 f_2(x_1, \dots, x_m) + \cdots + \beta_n f_n(x_1, \dots, x_m)\text{,} \end{equation*}
where the functions \(f_i\) are known, but not necessarily linear. Keep in mind that this is a linear problem in the \(\beta_i\) variables.

Example 6.63.

For the remaining four examples, we will fit various curves to the following points:
\begin{equation*} (-1,-3), (0,0), (1,3), (2,2)\text{.} \end{equation*}
Once you find the curve, graph the points and the curve on Desmos and see how good the curve fits.
We will start by fitting a linear curve to the data:
\begin{equation*} y = \beta_0 + \beta_1 x\text{.} \end{equation*}
This one can be solved without the need of a calculator.
Solution.
We start with the four equations which come from our data points:
\begin{alignat*}{3} (-1,-3) \amp \rightarrow -3 \amp = \beta_0 + \beta_1(-1) \amp \implies \beta_0 - \phantom{2}\beta_1 \amp = -3 \\ (0,0) \amp \rightarrow \phantom{-}0 \amp = \beta_0 + \phantom{-}\beta_1(0) \amp \implies \beta_0 \phantom{+ \beta_1} \amp = \phantom{-}0\\ (1,3) \amp \rightarrow \phantom{-}3 \amp = \beta_0 + \phantom{-}\beta_1(1) \amp \implies \beta_0 + \phantom{2}\beta_1 \amp = \phantom{-}3\\ (2,2) \amp \rightarrow \phantom{-}2 \amp = \beta_0 + \phantom{-}\beta_1(2) \amp \implies \beta_0 + 2\beta_1 \amp = \phantom{-}2 \end{alignat*}
This leads to the system
\begin{equation*} \begin{bmatrix} 1 \amp -1 \\ 1 \amp 0 \\ 1 \amp 1 \\ 1 \amp 2 \end{bmatrix}\begin{bmatrix} \beta_0 \\ \beta_1 \end{bmatrix} = \begin{bmatrix} -3 \\ 0 \\ 3 \\ 2 \end{bmatrix} \end{equation*}
which is an inconsistent system. Therefore, we find the least-squares solution. Note that
\begin{equation*} A^TA = \begin{bmatrix} 1 \amp 1 \amp 1 \amp 1 \\ -1 \amp 0 \amp 1 \amp 2 \end{bmatrix}\begin{bmatrix} 1 \amp -1 \\ 1 \amp 0 \\ 1 \amp 1 \\ 1 \amp 2 \end{bmatrix} = \begin{bmatrix} 4 \amp 2 \\ 2 \amp 6 \end{bmatrix} \end{equation*}
and
\begin{equation*} A^T\vec b = \begin{bmatrix}1 \amp 1 \amp 1 \amp 1 \\ -1 \amp 0 \amp 1 \amp 2 \end{bmatrix}\begin{bmatrix} -3 \\ 0 \\ 3 \\ 2\end{bmatrix} = \begin{bmatrix} 2 \\ 10 \end{bmatrix}\text{.} \end{equation*}
So, the normal equations are
\begin{equation*} \begin{bmatrix} 4 \amp 2 \\ 2 \amp 6 \end{bmatrix}\begin{bmatrix} \beta_0 \\ \beta_1 \end{bmatrix} = \begin{bmatrix} 2 \\ 10 \end{bmatrix}\text{.} \end{equation*}
We have that
\begin{align*} \begin{bmatrix} 4 \amp 2 \amp \rvert \amp 2 \\ 2 \amp 6 \amp \rvert \amp 10 \end{bmatrix} \amp \sim \begin{bmatrix} 1 \amp 3 \amp \rvert \amp 5 \\ 2 \amp 1 \amp \rvert \amp 1 \end{bmatrix}\\ \amp \sim \begin{bmatrix} 1 \amp 3 \amp \rvert \amp 5 \\ 0 \amp -5 \amp \rvert \amp -9 \end{bmatrix}\\ \amp \sim \begin{bmatrix} 1 \amp 3 \amp \rvert \amp 5 \\ 0 \amp 1 \amp \rvert \amp \frac{9}{5} \end{bmatrix}\\ \amp \sim \begin{bmatrix} 1 \amp 0 \amp \rvert \amp -\frac{2}{5} \\ 0 \amp 1 \amp \rvert \amp \frac{9}{5} \end{bmatrix} \end{align*}
Therefore, the line of best fit is
\begin{equation*} y = -\frac{2}{5} + \frac{9}{5}x\text{.} \end{equation*}
The graph below displays how well this line fits the four data points.
A graph containing the line of best fit for the four points (-1,-3), (0,0), (1,3), (2,2).

Example 6.64.

Continuing from ExampleΒ 6.63, we will now fit a quadratic curve to the data:
\begin{equation*} y = \beta_0 + \beta_1 x + \beta_2 x^2\text{.} \end{equation*}
For the remaining problems, feel free to use a matrix equation solver after setting up the least squares problem as \(A^TA\widehat x = A^T\vec b\text{.}\)
Solution.
Again, we start with the four equations which come from our data points. The difference here is that we will have three variables, \(\beta_0,\beta_1,\beta_2\text{,}\) which will produce an additional column in \(A\text{.}\)
\begin{alignat*}{3} (-1,-3) \amp \rightarrow -3 \amp = \beta_0 + \beta_1(-1) + \beta_2(-1)^2 \amp \implies \beta_0 - \phantom{2}\beta_1 + \phantom{4}\beta_2 \amp = -3 \\ (0,0) \amp \rightarrow \phantom{-}0 \amp = \beta_0 + \phantom{-}\beta_1(0) + \phantom{-}\beta_2(0)^2 \amp \implies \beta_0 \phantom{+ 2\beta_1 + 4\beta_2} \amp = \phantom{-}0\\ (1,3) \amp \rightarrow \phantom{-}3 \amp = \beta_0 + \phantom{-}\beta_1(1) + \phantom{-}\beta_2(1)^2 \amp \implies \beta_0 + \phantom{2}\beta_1 + \phantom{4}\beta_2 \amp = \phantom{-}3\\ (2,2) \amp \rightarrow \phantom{-}2 \amp = \beta_0 + \phantom{-}\beta_1(2) + \phantom{-}\beta_2(2)^2 \amp \implies \beta_0 + 2\beta_1 + 4\beta_2 \amp = \phantom{-}2 \end{alignat*}
This leads to the system
\begin{equation*} \begin{bmatrix} 1 \amp -1 \amp 1\\ 1 \amp 0 \amp 0 \\ 1 \amp 1 \amp 1 \\ 1 \amp 2 \amp 4 \end{bmatrix}\begin{bmatrix} \beta_0 \\ \beta_1 \\ \beta_2 \end{bmatrix} = \begin{bmatrix} -3 \\ 0 \\ 3 \\ 2 \end{bmatrix} \end{equation*}
which is an inconsistent system. Therefore, we find the least-squares solution. Note that
\begin{equation*} A^TA = \begin{bmatrix} 1 \amp 1 \amp 1 \amp 1 \\ -1 \amp 0 \amp 1 \amp 2 \\ 1 \amp 0 \amp 1 \amp 4 \end{bmatrix}\begin{bmatrix} 1 \amp -1 \amp 1\\ 1 \amp 0 \amp 0 \\ 1 \amp 1 \amp 1 \\ 1 \amp 2 \amp 4 \end{bmatrix} = \begin{bmatrix} 4 \amp 2 \amp 6 \\ 2 \amp 6 \amp 8 \\ 6 \amp 8 \amp 18 \end{bmatrix} \end{equation*}
and
\begin{equation*} A^T\vec b = \begin{bmatrix} 1 \amp 1 \amp 1 \amp 1 \\ -1 \amp 0 \amp 1 \amp 2 \\ 1 \amp 0 \amp 1 \amp 4 \end{bmatrix}\begin{bmatrix} -3 \\ 0 \\ 3 \\ 2\end{bmatrix} = \begin{bmatrix} 2 \\ 10 \\ 8 \end{bmatrix}\text{.} \end{equation*}
So, the normal equations are
\begin{equation*} \begin{bmatrix} 4 \amp 2 \amp 6 \\ 2 \amp 6 \amp 8 \\ 6 \amp 8 \amp 18 \end{bmatrix} = \begin{bmatrix} 2 \\ 10 \\ 8 \end{bmatrix}\text{.} \end{equation*}
We have that
\begin{equation*} \begin{bmatrix} 4 \amp 2 \amp 6 \amp \rvert \amp 2 \\ 2 \amp 6 \amp 8 \amp \rvert \amp 10 \\ 6 \amp 8 \amp 18 \amp \rvert \amp 8 \end{bmatrix} \sim \begin{bmatrix} 1 \amp 0 \amp 0 \amp \rvert \amp \frac{3}{5} \\ 0 \amp 1 \amp 0 \amp \rvert \amp \frac{14}{5} \\ 0 \amp 0 \amp 1 \amp \rvert \amp -1 \end{bmatrix}\text{.} \end{equation*}
Therefore, the quadratic which best fits the data is
\begin{equation*} y = \frac{3}{5} + \frac{14}{5}x - x^2\text{.} \end{equation*}
The graph below displays how well this quadratic fits the four data points.
A graph containing the quadratic of best fit for the four points (-1,-3), (0,0), (1,3), (2,2).

Example 6.65.

Continuing from ExampleΒ 6.63, we will now fit a cubic curve to the data:
\begin{equation*} y = \beta_0 + \beta_1 x + \beta_2 x^2 + \beta_3 x^3\text{.} \end{equation*}
What do you notice about your least-squares solution? Is this expected?
Solution.
Note that the four equations which come from our data points and this cubic model are:
\begin{alignat*}{2} (-1,-3) \amp \rightarrow \beta_0 - \phantom{2}\beta_1 + \phantom{4}\beta_2 - \phantom{2}\beta_3 \amp = -3 \\ (0,0) \amp \rightarrow \beta_0 \phantom{+ 2\beta_1 + 4\beta_2 + 8\beta_3} \amp = \phantom{-}0\\ (1,3) \amp \rightarrow \beta_0 + \phantom{2}\beta_1 + \phantom{4}\beta_2 + \phantom{8}\beta_3 \amp = \phantom{-}3\\ (2,2) \amp \rightarrow \beta_0 + 2\beta_1 + 4\beta_2 + 8\beta_3 \amp = \phantom{-}2 \end{alignat*}
This leads to the system
\begin{equation*} \begin{bmatrix} 1 \amp -1 \amp 1 \amp -1 \\ 1 \amp 0 \amp 0 \amp 0 \\ 1 \amp 1 \amp 1 \amp 1 \\ 1 \amp 2 \amp 4 \amp 8 \end{bmatrix}\begin{bmatrix} \beta_0 \\ \beta_1 \\ \beta_2 \\ \beta_3 \end{bmatrix} = \begin{bmatrix} -3 \\ 0 \\ 3 \\ 2 \end{bmatrix}\text{.} \end{equation*}
This time the system \(A\vec x = \vec b\) is consistent, so there is no need to find the least-squares solution. Note that
\begin{equation*} \begin{bmatrix} 1 \amp -1 \amp 1 \amp -1 \amp \rvert \amp -3 \\ 1 \amp 0 \amp 0 \amp 0 \amp \rvert \amp 0 \\ 1 \amp 1 \amp 1 \amp 1 \amp \rvert \amp 3 \\ 1 \amp 2 \amp 4 \amp 8 \amp \rvert \amp 2 \end{bmatrix} \sim \begin{bmatrix} 1 \amp 0 \amp 0 \amp 0 \amp \rvert \amp 0 \\ 0 \amp 1 \amp 0 \amp 0 \amp \rvert \amp \frac{11}{3} \\ 0 \amp 0 \amp 1 \amp 0 \amp \rvert \amp 0 \\ 0 \amp 0 \amp 0 \amp 1 \amp \rvert \amp -\frac{2}{3}\end{bmatrix}\text{.} \end{equation*}
Therefore, the cubic which perfectly fits the data is
\begin{equation*} y = \frac{11}{3}x - \frac{2}{3}x^3\text{.} \end{equation*}
The graph below shows how this cubic fits the four data points perfectly.
A graph containing the cubic which perfectly fits the four points (-1,-3), (0,0), (1,3), (2,2).
Note that if we did calculate the normal equations and find the least-squares solution to the system, then it would have given the exact solution to \(A\vec x = \vec b\text{,}\) So, there is nothing wrong with finding the least-squares solution to a consistent system since it will still give you the correct answer, it will just take more time and effort than solving the system directly.

Example 6.66.

Continuing from ExampleΒ 6.63, we will now fit a somewhat trigonometric curve to the data:
\begin{equation*} y = \beta_0 x + \beta_1 \sin\left(\frac{\pi x}{2}\right)\text{.} \end{equation*}
What do you notice about your least-squares solution?
Solution.
Note that the four equations which come from our data points and this model are:
\begin{alignat*}{3} (-1,-3) \amp \rightarrow -3 \amp = \beta_0(-1) + \beta_1\sin\left(\frac{\pi(-1)}{2}\right) \amp \implies -\beta_0 - \beta_1 \amp = -3 \\ (0,0) \amp \rightarrow \phantom{-}0 \amp = \beta_0(0) + \beta_1\sin\left(\frac{\pi(0)}{2}\right) \amp \implies 0 \amp = \phantom{-}0\\ (1,3) \amp \rightarrow \phantom{-}3 \amp = \beta_0(1) + \beta_1\sin\left(\frac{\pi(1)}{2}\right) \amp \implies \phantom{2}\beta_0 + \beta_1 \amp = \phantom{-}3\\ (2,2) \amp \rightarrow \phantom{-}2 \amp = \beta_0(2) + \beta_1\sin\left(\frac{\pi(2)}{2}\right) \amp \implies 2\beta_0 \phantom{+ \beta_1} \amp = \phantom{-}2 \end{alignat*}
This leads to the system
\begin{equation*} \begin{bmatrix} -1 \amp -1 \\ 0 \amp 0 \\ 1 \amp 1 \\ 2 \amp 0 \end{bmatrix}\begin{bmatrix} \beta_0 \\ \beta_1 \end{bmatrix} = \begin{bmatrix} -3 \\ 0 \\ 3 \\ 2 \end{bmatrix}\text{.} \end{equation*}
Surprisingly, this system \(A\vec x = \vec b\) is consistent. Note that
\begin{equation*} \begin{bmatrix} -1 \amp -1 \amp \rvert \amp -3 \\ 0 \amp 0 \amp \rvert \amp 0 \\ 1 \amp 1 \amp \rvert \amp 3 \\ 2 \amp 0 \amp \rvert \amp 2 \end{bmatrix} \sim \begin{bmatrix} 1 \amp 0 \amp \rvert \amp 1 \\ 0 \amp 1 \amp \rvert \amp 2 \\ 0 \amp 0 \amp \rvert \amp 0 \\ 0 \amp 0 \amp \rvert \amp 0 \end{bmatrix}\text{.} \end{equation*}
Therefore, the curve of this type which perfectly fits the data is
\begin{equation*} y = 1x +2\sin\left(\frac{\pi x}{2}\right)\text{.} \end{equation*}
The graph below displays how this model perfectly fits the four data points.
A graph containing the curve of the above type which perfectly fits the four points (-1,-3), (0,0), (1,3), (2,2).