M301 · Linear Algebra · Week 3 Recap

Recap: Linear Independence and Linear Transformations

A short review of the two topics of the week. Each worked question is followed by an exercise of the same type. Exercises are for self-check; they are not graded.

1. Deciding linear independence

Before row reducing, look for a shortcut. Four of the five parts below have one; only the last needs the full computation.

Question 1

Decide whether each set is linearly independent or linearly dependent.

(a) \(\begin{bmatrix}2\\-1\\3\end{bmatrix},\ \begin{bmatrix}0\\0\\0\end{bmatrix},\ \begin{bmatrix}5\\4\\1\end{bmatrix}\)

(b) \(\begin{bmatrix}1\\2\end{bmatrix},\ \begin{bmatrix}3\\-1\end{bmatrix},\ \begin{bmatrix}4\\4\end{bmatrix}\)

(c) \(\begin{bmatrix}2\\-4\\6\end{bmatrix},\ \begin{bmatrix}-3\\6\\-9\end{bmatrix}\)

(d) \(\begin{bmatrix}1\\2\\3\end{bmatrix},\ \begin{bmatrix}0\\4\\5\end{bmatrix},\ \begin{bmatrix}0\\0\\6\end{bmatrix}\)

(e) \(\begin{bmatrix}1\\-2\\3\end{bmatrix},\ \begin{bmatrix}2\\-3\\5\end{bmatrix},\ \begin{bmatrix}-1\\3\\-4\end{bmatrix}\)

Solution.

(a) Dependent. zero vector A set that contains \(\mathbf 0\) is always dependent: \(0\mathbf v_1+1\cdot\mathbf 0+0\mathbf v_3=\mathbf 0\) uses a nonzero weight.

(b) Dependent. too many vectors Three vectors in \(\mathbb R^2\): more vectors than entries, so the \(2\times3\) matrix has at most two pivots and a free variable.

(c) Dependent. multiple Two vectors: check the ratios \(-3/2,\ 6/(-4),\ -9/6\). All equal \(-\tfrac32\), so \(\mathbf v_2=-\tfrac32\mathbf v_1\).

(d) Independent. triangular pattern Suppose \(c_1\mathbf v_1+c_2\mathbf v_2+c_3\mathbf v_3=\mathbf 0\). The first entries give \(c_1\cdot1+c_2\cdot0+c_3\cdot0=0\), so \(c_1=0\). The second entries then give \(4c_2=0\), so \(c_2=0\). The third entries give \(6c_3=0\), so \(c_3=0\). Only the trivial solution: independent. This works whenever the vectors, written as columns, form a triangular matrix with nonzero diagonal entries; no row reduction is needed.

(e) Dependent. long way No shortcut applies: three vectors in \(\mathbb R^3\), none a multiple of another, no zeros. Row reduce \([\mathbf v_1\ \mathbf v_2\ \mathbf v_3]\): \(R_2\to R_2+2R_1\), \(R_3\to R_3-3R_1\), then \(R_3\to R_3+R_2\), then \(R_1\to R_1-2R_2\):

\[\begin{bmatrix}1&2&-1\\-2&-3&3\\3&5&-4\end{bmatrix}\sim\begin{bmatrix}1&2&-1\\0&1&1\\0&-1&-1\end{bmatrix}\sim\begin{bmatrix}1&2&-1\\0&1&1\\0&0&0\end{bmatrix}\sim\begin{bmatrix}1&0&-3\\0&1&1\\0&0&0\end{bmatrix}\]

Column 3 has no pivot, so the set is dependent. From \(x_1=3x_3\), \(x_2=-x_3\) with \(x_3=1\): \(3\mathbf v_1-\mathbf v_2+\mathbf v_3=\mathbf 0\). Check: \(3-2-1=0\), \(-6+3+3=0\), \(9-5-4=0\).

Exercise 1

Number fields accept decimals with a comma (1,5) and simple fractions (3/2).

Decide whether each set is linearly independent or dependent. Use a shortcut where one exists; the shortcuts are not in the same order as in Question 1. For (c), also give weights \(c_1,c_2,c_3\), not all zero, with \(c_1\mathbf v_1+c_2\mathbf v_2+c_3\mathbf v_3=\mathbf 0\), or leave them empty if you think the set is independent; any correct relation is accepted.

(a) \(\begin{bmatrix}0\\0\\2\end{bmatrix},\ \begin{bmatrix}0\\3\\1\end{bmatrix},\ \begin{bmatrix}5\\4\\-1\end{bmatrix}\)
(b) \(\begin{bmatrix}4\\-6\\2\end{bmatrix},\ \begin{bmatrix}-6\\9\\-4\end{bmatrix}\)
(c) \(\mathbf v_1=\begin{bmatrix}1\\3\\-1\end{bmatrix},\ \mathbf v_2=\begin{bmatrix}2\\5\\1\end{bmatrix},\ \mathbf v_3=\begin{bmatrix}1\\1\\5\end{bmatrix}\)
\(c_1,\ c_2,\ c_3\) for (c):
(d) \(\begin{bmatrix}3\\1\\-2\end{bmatrix},\ \begin{bmatrix}6\\0\\1\end{bmatrix},\ \begin{bmatrix}0\\0\\0\end{bmatrix}\)
(e) \(\begin{bmatrix}1\\0\\3\end{bmatrix},\ \begin{bmatrix}2\\1\\1\end{bmatrix},\ \begin{bmatrix}0\\5\\4\end{bmatrix},\ \begin{bmatrix}1\\1\\1\end{bmatrix}\)
Solution

(a) Independent: triangular pattern. From \(c_1\mathbf v_1+c_2\mathbf v_2+c_3\mathbf v_3=\mathbf 0\), the first entries give \(5c_3=0\), the second then give \(3c_2=0\), the third give \(2c_1=0\). Only the trivial solution.

(b) Independent: the ratios are \(-6/4=-\tfrac32\), \(9/(-6)=-\tfrac32\), but \(-4/2=-2\). Neither vector is a multiple of the other.

(c) Dependent. No shortcut applies. Row reduce \([\mathbf v_1\ \mathbf v_2\ \mathbf v_3]\): \(R_2\to R_2-3R_1\), \(R_3\to R_3+R_1\), then \(R_3\to R_3+3R_2\), then \(R_2\to-R_2\) and \(R_1\to R_1-2R_2\):

\[\begin{bmatrix}1&2&1\\3&5&1\\-1&1&5\end{bmatrix}\sim\begin{bmatrix}1&2&1\\0&-1&-2\\0&3&6\end{bmatrix}\sim\begin{bmatrix}1&2&1\\0&-1&-2\\0&0&0\end{bmatrix}\sim\begin{bmatrix}1&0&-3\\0&1&2\\0&0&0\end{bmatrix}\]

So \(x_1=3x_3\), \(x_2=-2x_3\). With \(x_3=1\): \(3\mathbf v_1-2\mathbf v_2+\mathbf v_3=\mathbf 0\). Check: \(3-4+1=0\), \(9-10+1=0\), \(-3-2+5=0\). Any nonzero multiple of \(\begin{bmatrix}3\\-2\\1\end{bmatrix}\) is also correct.

(d) Dependent: the set contains the zero vector.

(e) Dependent: four vectors in \(\mathbb R^3\).

2. Linear transformations

2.1 From a matrix to the general formula

Method

For \(T(\mathbf x)=A\mathbf x\), multiply \(A\) by the column \(\begin{bmatrix}x_1\\\vdots\\x_n\end{bmatrix}\). Row \(i\) of \(A\) gives component \(i\) of \(T(\mathbf x)\): the entries of the row are the coefficients of \(x_1,\dots,x_n\). In the other direction, the coefficients in the formula are the rows of \(A\).

Question 2

(a) Let \(A=\begin{bmatrix}2&-1&0\\3&0&5\end{bmatrix}\). Write a formula for \(T\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix}=A\mathbf x\).
(b) Let \(T\begin{bmatrix}x_1\\x_2\end{bmatrix}=\begin{bmatrix}4x_1-x_2\\x_2\\-x_1+3x_2\end{bmatrix}\). Find the matrix \(A\) with \(T(\mathbf x)=A\mathbf x\).

Solution.

(a) \(A\mathbf x=\begin{bmatrix}2x_1-x_2+0x_3\\3x_1+0x_2+5x_3\end{bmatrix}\), so \(T\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix}=\begin{bmatrix}2x_1-x_2\\3x_1+5x_3\end{bmatrix}\). Here \(T:\mathbb R^3\to\mathbb R^2\).

(b) Read the coefficients of \(x_1,x_2\) in each component as a row: \(A=\begin{bmatrix}4&-1\\0&1\\-1&3\end{bmatrix}\). Check: \(A\mathbf x=\begin{bmatrix}4x_1-x_2\\x_2\\-x_1+3x_2\end{bmatrix}\).

Exercise 2

(a) Let \(A=\begin{bmatrix}1&-2\\0&4\\-3&1\end{bmatrix}\) and \(T(\mathbf x)=A\mathbf x\). Write the three components of \(T\begin{bmatrix}x_1\\x_2\end{bmatrix}\). Type expressions such as 2x1-3x2 (use x1, x2; * is optional).

\(T\begin{bmatrix}x_1\\x_2\end{bmatrix}=\)

(b) Let \(T\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix}=\begin{bmatrix}x_1+3x_3\\-2x_2+x_3\end{bmatrix}\). Enter the matrix \(A\) with \(T(\mathbf x)=A\mathbf x\).

\(A=\)
Solution

(a) \(T\begin{bmatrix}x_1\\x_2\end{bmatrix}=\begin{bmatrix}x_1-2x_2\\4x_2\\-3x_1+x_2\end{bmatrix}\).

(b) \(A=\begin{bmatrix}1&0&3\\0&-2&1\end{bmatrix}\); the rows are the coefficients of \(x_1,x_2,x_3\) in the two components.

2.2 Is a given map linear?

Method

1. Compute \(T(\mathbf 0)\). If it is not \(\mathbf 0\), \(T\) is not linear. Done.
2. If every component of \(T(\mathbf x)\) is a sum of terms of the form (constant)\(\cdot x_i\), then \(T(\mathbf x)=A\mathbf x\) for the matrix of coefficients, so \(T\) is linear.
3. Otherwise (a product \(x_1x_2\), a square, an absolute value, a constant term), find one specific \(\mathbf u\) and scalar \(c\) with \(T(c\mathbf u)\ne cT(\mathbf u)\), or specific \(\mathbf u,\mathbf v\) with \(T(\mathbf u+\mathbf v)\ne T(\mathbf u)+T(\mathbf v)\).

Question 3

Decide whether each map is linear.
(a) \(T\begin{bmatrix}x_1\\x_2\end{bmatrix}=\begin{bmatrix}x_1+2\\x_2\end{bmatrix}\)
(b) \(T\begin{bmatrix}x_1\\x_2\end{bmatrix}=\begin{bmatrix}x_1x_2\\x_1\end{bmatrix}\)
(c) \(T\begin{bmatrix}x_1\\x_2\end{bmatrix}=\begin{bmatrix}3x_1-x_2\\x_1\end{bmatrix}\)

Solution.

(a) Not linear: \(T\begin{bmatrix}0\\0\end{bmatrix}=\begin{bmatrix}2\\0\end{bmatrix}\ne\begin{bmatrix}0\\0\end{bmatrix}\).

(b) \(T\begin{bmatrix}0\\0\end{bmatrix}=\begin{bmatrix}0\\0\end{bmatrix}\), so step 1 does not decide. The product \(x_1x_2\) is suspicious; test scaling with \(\mathbf u=\begin{bmatrix}1\\1\end{bmatrix}\), \(c=2\): \(T\begin{bmatrix}2\\2\end{bmatrix}=\begin{bmatrix}4\\2\end{bmatrix}\) but \(2T\begin{bmatrix}1\\1\end{bmatrix}=2\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}2\\2\end{bmatrix}\). Not linear.

(c) Both components are sums of constant times \(x_i\): \(T(\mathbf x)=\begin{bmatrix}3&-1\\1&0\end{bmatrix}\mathbf x\). Linear.

Exercise 3

Linear or not?

(a) \(T\begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix}=\begin{bmatrix}x_1-x_3\\2x_2\end{bmatrix}\)
(b) \(T\begin{bmatrix}x_1\\x_2\end{bmatrix}=\begin{bmatrix}x_1^2\\x_2\end{bmatrix}\)
(c) \(T\begin{bmatrix}x_1\\x_2\end{bmatrix}=\begin{bmatrix}x_1+x_2+1\\x_1\end{bmatrix}\)
(d) \(T\begin{bmatrix}x_1\\x_2\end{bmatrix}=\begin{bmatrix}0\\5x_1-3x_2\end{bmatrix}\)
(e) \(T\begin{bmatrix}x_1\\x_2\end{bmatrix}=\begin{bmatrix}|x_1|\\x_2\end{bmatrix}\)
Solution

(a) Linear: matrix \(\begin{bmatrix}1&0&-1\\0&2&0\end{bmatrix}\).

(b) Not linear: \(T\begin{bmatrix}2\\0\end{bmatrix}=\begin{bmatrix}4\\0\end{bmatrix}\) but \(2T\begin{bmatrix}1\\0\end{bmatrix}=\begin{bmatrix}2\\0\end{bmatrix}\).

(c) Not linear: \(T\begin{bmatrix}0\\0\end{bmatrix}=\begin{bmatrix}1\\0\end{bmatrix}\).

(d) Linear: matrix \(\begin{bmatrix}0&0\\5&-3\end{bmatrix}\). A zero component is allowed.

(e) Not linear: \(T\begin{bmatrix}-1\\0\end{bmatrix}=\begin{bmatrix}1\\0\end{bmatrix}\) but \(-T\begin{bmatrix}1\\0\end{bmatrix}=\begin{bmatrix}-1\\0\end{bmatrix}\).

2.3 Computing images of a linear map

Method

Notation: \(\mathbf e_1,\dots,\mathbf e_n\) are the vectors in \(\mathbb R^n\) with a single \(1\) and zeros elsewhere; \(\mathbf e_i\) has its \(1\) in position \(i\). In \(\mathbb R^2\), \(\mathbf e_1=\begin{bmatrix}1\\0\end{bmatrix}\) and \(\mathbf e_2=\begin{bmatrix}0\\1\end{bmatrix}\). Every vector is a combination of them with its own entries as weights:

\[\mathbf x=\begin{bmatrix}x_1\\x_2\end{bmatrix}=x_1\begin{bmatrix}1\\0\end{bmatrix}+x_2\begin{bmatrix}0\\1\end{bmatrix}=x_1\mathbf e_1+x_2\mathbf e_2,\]

and in general \(\mathbf x=x_1\mathbf e_1+\cdots+x_n\mathbf e_n\). (These vectors did not appear in the lecture; they are the columns of the identity matrix.)

Depending on what is given:
1. A matrix or a formula: compute \(A\mathbf x\) directly.
2. The images of \(\mathbf e_1,\dots,\mathbf e_n\): since \(\mathbf x=x_1\mathbf e_1+\cdots+x_n\mathbf e_n\), linearity gives \(T(\mathbf x)=x_1T(\mathbf e_1)+\cdots+x_nT(\mathbf e_n)\). For example, if \(T(\mathbf e_1)\) and \(T(\mathbf e_2)\) are known, then \(T\begin{bmatrix}3\\-2\end{bmatrix}=3T(\mathbf e_1)-2T(\mathbf e_2)\).
3. The images of other vectors \(\mathbf u,\mathbf v\): first solve \(\mathbf x=a\mathbf u+b\mathbf v\) for \(a,b\) (a small linear system), then \(T(\mathbf x)=aT(\mathbf u)+bT(\mathbf v)\).

Question 4

A linear map \(T:\mathbb R^2\to\mathbb R^2\) satisfies \(T\begin{bmatrix}1\\1\end{bmatrix}=\begin{bmatrix}2\\0\end{bmatrix}\) and \(T\begin{bmatrix}1\\-1\end{bmatrix}=\begin{bmatrix}0\\4\end{bmatrix}\). Find \(T\begin{bmatrix}3\\1\end{bmatrix}\).

Solution. Method 3. Write \(\begin{bmatrix}3\\1\end{bmatrix}=a\begin{bmatrix}1\\1\end{bmatrix}+b\begin{bmatrix}1\\-1\end{bmatrix}\): \(a+b=3\) and \(a-b=1\), so \(a=2\), \(b=1\). Then

\[T\begin{bmatrix}3\\1\end{bmatrix}=2\,T\begin{bmatrix}1\\1\end{bmatrix}+1\cdot T\begin{bmatrix}1\\-1\end{bmatrix}=2\begin{bmatrix}2\\0\end{bmatrix}+\begin{bmatrix}0\\4\end{bmatrix}=\begin{bmatrix}4\\4\end{bmatrix}.\]
Exercise 4

(a) A linear map \(T:\mathbb R^2\to\mathbb R^2\) has \(T(\mathbf e_1)=\begin{bmatrix}1\\2\end{bmatrix}\) and \(T(\mathbf e_2)=\begin{bmatrix}-3\\1\end{bmatrix}\). Find \(T\begin{bmatrix}4\\-1\end{bmatrix}\).

\(T\begin{bmatrix}4\\-1\end{bmatrix}=\)

(b) A linear map \(S:\mathbb R^2\to\mathbb R^2\) has \(S\begin{bmatrix}1\\2\end{bmatrix}=\begin{bmatrix}5\\1\end{bmatrix}\) and \(S\begin{bmatrix}0\\1\end{bmatrix}=\begin{bmatrix}2\\-2\end{bmatrix}\). Find \(S\begin{bmatrix}2\\7\end{bmatrix}\).

\(S\begin{bmatrix}2\\7\end{bmatrix}=\)
Solution

(a) \(T\begin{bmatrix}4\\-1\end{bmatrix}=4T(\mathbf e_1)-T(\mathbf e_2)=4\begin{bmatrix}1\\2\end{bmatrix}-\begin{bmatrix}-3\\1\end{bmatrix}=\begin{bmatrix}7\\7\end{bmatrix}\).

(b) \(\begin{bmatrix}2\\7\end{bmatrix}=a\begin{bmatrix}1\\2\end{bmatrix}+b\begin{bmatrix}0\\1\end{bmatrix}\) gives \(a=2\) and \(2a+b=7\), so \(b=3\). Then \(S\begin{bmatrix}2\\7\end{bmatrix}=2\begin{bmatrix}5\\1\end{bmatrix}+3\begin{bmatrix}2\\-2\end{bmatrix}=\begin{bmatrix}16\\-4\end{bmatrix}\).

Bonus: linear maps and images

A digital image is a grid of pixels. A \(2\times2\) matrix \(A\) can act on the position \(\begin{bmatrix}x_1\\x_2\end{bmatrix}\) of each pixel: the pixel at \(\mathbf x\) is moved to \(A\mathbf x\). Below, the origin is at the center of the picture. Try the preset matrices, or enter your own and apply it.

Pixel experiment
\(A=\)
original
after \(\mathbf x\mapsto A\mathbf x\)

Each pixel is a small square; its four corners are mapped by \(A\). Because \(A\) is linear, squares become parallelograms and straight edges stay straight.

Exercise 5

(a) Which matrix flips the picture upside down (top and bottom exchanged, left and right unchanged)?

(b) Image software also changes pixel values. Store a grayscale image with \(n\) pixels as a vector \(\mathbf p\) in \(\mathbb R^n\) (one entry per pixel, \(0\) = black, \(255\) = white). Which of these operations are linear transformations of \(\mathbf p\)?

brightness: add \(40\) to every pixel value
contrast: multiply every pixel value by \(1.5\)
negative: replace every value \(p\) by \(255-p\)
blur: replace every value by the average of itself and its neighbours
Solution

(a) \(\begin{bmatrix}1&0\\0&-1\end{bmatrix}\): it sends \(\begin{bmatrix}x_1\\x_2\end{bmatrix}\) to \(\begin{bmatrix}x_1\\-x_2\end{bmatrix}\), so only the vertical coordinate changes sign. The first matrix flips left-right, the third reflects through the line \(x_2=x_1\), the fourth rotates by \(180^\circ\).

(b) Brightness: not linear, the zero image (all black) is sent to a gray image, so \(T(\mathbf 0)\ne\mathbf 0\). Contrast: linear, \(T(\mathbf p)=1.5\mathbf p\). Negative: not linear, \(T(\mathbf 0)\) is the all-white image. Blur: linear, each new value is a fixed combination of old values with constant weights, so \(T(\mathbf p)=A\mathbf p\) for a large matrix \(A\) whose rows hold the averaging weights.