GSLA Chapter 1 Problem Set (Optional)

Problem Set 1.1

  1. Compute u+v+w\boldsymbol{u} + \boldsymbol{v} + \boldsymbol{w} and 2u+2v+w2\boldsymbol{u} + 2\boldsymbol{v} + \boldsymbol{w}. How do you know u\boldsymbol{u}, v\boldsymbol{v}, w\boldsymbol{w} lie in a plane?

u=[123],v=[312],w=[231].\boldsymbol{u} = \begin{bmatrix*}[r] 1 \\ 2 \\ 3\end{bmatrix*}, \quad \boldsymbol{v} = \begin{bmatrix*}[r] -3 \\ 1 \\ -2\end{bmatrix*}, \quad \boldsymbol{w} = \begin{bmatrix*}[r] 2 \\ -3 \\ -1\end{bmatrix*}.

Proof We can find cc and dd s.t. w=cu+dv\boldsymbol{w} = c \boldsymbol{u} + d \boldsymbol{v}, which can be done by solving three linear equations

{c3d=22c+d=33c2d=1\left\{ \begin{align*} c - 3d &= 2 \\ 2c + d &= -3 \\ 3c - 2d &= 1 \end{align*} \right.

The solution to these equations is

{c=1d=1\left\{ \begin{align*} c = -1\\ d = -1 \end{align*} \right.

Hence u\boldsymbol{u}, v\boldsymbol{v}, w\boldsymbol{w} lie in a plane.

  1. Every combination of v=(1,2,1)\boldsymbol{v} = (1, -2, 1) and w=(0,1,1)\boldsymbol{w} = (0, 1, -1) has components that add to ____\_\_\_\_ . Find cc and dd so that cv+dw=(3,3,6)c \boldsymbol{v} + d \boldsymbol{w} = (3, 3, -6). Why is (3,3,6)(3, 3, 6) impossible?

Blank00Solution Solving the system of equations

{c=32c+d=3cd=6\left\{ \begin{align*} c &= 3 \\ -2c + d &= 3 \\ c - d &= -6 \end{align*} \right.

we get

{c=3d=9\left\{ \begin{align*} c &= 3\\ d &= 9 \end{align*} \right.

Proof In the process of solving the system of equations

{c=32c+d=3cd=6\left\{ \begin{align*} c &= 3 \\ -2c + d &= 3 \\ c - d &= 6 \end{align*} \right.

we will get the formula 0=10 = 1, which is ridiculous. Thus (3,3,6)(3, 3, 6) is impossible.

  1. Find vectors v\boldsymbol{v} and v\boldsymbol{v} so that v+w=(4,5,6)\boldsymbol{v} + \boldsymbol{w} = (4, 5, 6) and vw=(2,5,8)\boldsymbol{v} - \boldsymbol{w} = (2, 5, 8). This is a question with ____\_\_\_\_ unknown numbers, and an equal number of equations to find those numbers.

Blank66

Problem Set 1.2

  1. For any unit vectors v and w, find the dot products (actual numbers) of

    (a)vandv(b)v+wandvw(c)v2wandv+2w\text{(a)}\quad \boldsymbol{v} \,\,\text{and}\, -\boldsymbol{v} \qquad \text{(b)}\quad \boldsymbol{v} + \boldsymbol{w} \,\,\text{and}\,\, \boldsymbol{v} - \boldsymbol{w} \qquad \text{(c)}\quad \boldsymbol{v} - 2 \boldsymbol{w} \,\,\text{and}\,\, \boldsymbol{v} + 2 \boldsymbol{w}

Solutionv\boldsymbol{v} and w\boldsymbol{w} are both unit vectors, which implies that vv=1\boldsymbol{v} \cdot \boldsymbol{v} = 1 and ww=1\boldsymbol{w} \cdot \boldsymbol{w} = 1. (a) v(v)=vv=1\boldsymbol{v} \cdot (-\boldsymbol{v}) = -\boldsymbol{v} \cdot \boldsymbol{v} = -1. (b) (v+w)(vw)=vvww=11=0(\boldsymbol{v} + \boldsymbol{w}) \cdot (\boldsymbol{v} - \boldsymbol{w}) = \boldsymbol{v} \cdot \boldsymbol{v} - \boldsymbol{w} \cdot \boldsymbol{w} = 1 - 1 = 0. © (v2w)(v+2w)=vv+v2w2wv4ww=14=3(\boldsymbol{v} - 2\boldsymbol{w}) \cdot (\boldsymbol{v} + 2\boldsymbol{w}) = \boldsymbol{v} \cdot \boldsymbol{v} + \boldsymbol{v} \cdot 2\boldsymbol{w} -2\boldsymbol{w} \cdot \boldsymbol{v} - 4 \boldsymbol{w} \cdot \boldsymbol{w} = 1 - 4 = -3

  1. Find the angle θ\theta (from its cosine) between these pairs of vectors:

(a)v=[13]andw=[10](b)v=[221]andw=[212](c)v=[13]andw=[13](d)v=[31]andw=[12]\begin{aligned} &\text{(a)}\quad \boldsymbol{v} = \begin{bmatrix*}[c] 1 \\ \sqrt{3}\end{bmatrix*} \,\,\text{and}\,\, \boldsymbol{w} = \begin{bmatrix*}[c] 1 \\ 0\end{bmatrix*} & & \text{(b)}\quad \boldsymbol{v} = \begin{bmatrix*}[r] 2 \\ 2 \\ -1\end{bmatrix*} \,\,\text{and}\,\, \boldsymbol{w} = \begin{bmatrix*}[r] 2 \\ -1 \\ 2\end{bmatrix*} \\ &\text{(c)}\quad \boldsymbol{v} = \begin{bmatrix*}[c] 1 \\ \sqrt{3}\end{bmatrix*} \,\,\text{and}\,\, \boldsymbol{w} = \begin{bmatrix*}[c] -1 \\ \sqrt{3}\end{bmatrix*} & & \text{(d)}\quad \boldsymbol{v} = \begin{bmatrix*}[c] 3 \\ 1\end{bmatrix*} \,\,\text{and}\,\, \boldsymbol{w} = \begin{bmatrix*}[c] -1 \\ -2\end{bmatrix*} \\ \end{aligned}

Solution (a) cosθ=vwvw=11+3012+(3)2(3)12+02=12\cos \theta = \dfrac{\boldsymbol{v} \cdot \boldsymbol{w} }{||\boldsymbol{v}||\,||\boldsymbol{w}||} = \dfrac{1 \cdot 1 + \sqrt{3} \cdot 0}{\sqrt{1^2 + (\sqrt{3})^2} \, \sqrt{\vphantom{(\sqrt{3})}1^2 + 0^2} } = \dfrac{1}{2}, so θ\theta is equal to π3\dfrac{\pi}{3}. (b) cosθ=vwvw=22+2(1)+(1)222+22+(1)222+(1)2+22=0\cos \theta = \dfrac{\boldsymbol{v} \cdot \boldsymbol{w} }{||\boldsymbol{v}||\,||\boldsymbol{w}||} = \dfrac{2 \cdot 2 + 2 \cdot (-1) + (-1) \cdot 2}{\sqrt{2^2 + 2^2 + (-1)^2} \, \sqrt{2^2 + (-1)^2 + 2^2} } = 0, so θ\theta is equal to π2\dfrac{\pi}{2}. © cosθ=vwvw=1(1)+3312+(3)2(1)2+(3)2=12\cos \theta = \dfrac{\boldsymbol{v} \cdot \boldsymbol{w} }{||\boldsymbol{v}||\,||\boldsymbol{w}||} = \dfrac{1 \cdot (-1) + \sqrt{3} \cdot \sqrt{3} }{\sqrt{1^2 + (\sqrt{3})^2} \, \sqrt{(-1)^2 + (\sqrt{3})^2} } = \dfrac{1}{2}, so θ\theta is equal to π3\dfrac{\pi}{3}. (d) cosθ=vwvw=3(1)+1(2)32+12(1)2+(2)2=22\cos \theta = \dfrac{\boldsymbol{v} \cdot \boldsymbol{w} }{||\boldsymbol{v}||\,||\boldsymbol{w}||} = \dfrac{3 \cdot (-1) + 1 \cdot (-2)}{\sqrt{3^2 + 1^2} \, \sqrt{(-1)^2 + (-2)^2} } = -\dfrac{\sqrt{2} }{2}, so θ\theta is equal to 3π4\dfrac{3\pi}{4}.

  1. With v=(1,1)\boldsymbol{v} = (1, 1) and w=(1,5)\boldsymbol{w} = (1, 5) choose a number cc so that wcv\boldsymbol{w} - c \boldsymbol{v} is perpendicular to v\boldsymbol{v}. Then find the formula for cc starting from any nonzero v\boldsymbol{v} and w\boldsymbol{w}.

Solution To make wcv\boldsymbol{w} - c \boldsymbol{v} is perpendicular to v\boldsymbol{v}, we have (wcv)v=0(\boldsymbol{w} - c \boldsymbol{v}) \cdot \boldsymbol{v} = 0, which can be simplified to

c=wvvvc = \dfrac{\boldsymbol{w} \cdot \boldsymbol{v} }{\boldsymbol{v} \cdot \boldsymbol{v} }

When v=(1,1)\boldsymbol{v} = (1, 1) and w=(1,5)\boldsymbol{w} = (1, 5), cc is equal to 33.

  1. How could you prove xyz313(x+y+z)\sqrt[3]{xyz} \le \frac{1}{3}(x + y + z) (geometric mean is not greater than arithmetic mean)?

Proof Let a=x3a = \sqrt[3]{x}, b=y3b = \sqrt[3]{y} and c=z3c = \sqrt[3]{z}, where they are all positive numbers. We have

13(x+y+z)xyz3=13(a3+b3+c33abc)=13((a+b)(a2ab+b2)+c33abc)=13((a+b+c)(a2ab+b2)+c33abca2c+abcb2c)=13((a+b+c)(a2ab+b2)+c(c22aba2b2))=13((a+b+c)(a2ab+b2)c((a+b)2c2))=13((a+b+c)(a2ab+b2)c(a+b+c)(a+bc))=13(a+b+c)(a2ab+b2c(a+bc))=13(a+b+c)(a2+b2+c2(ab+bc+ca))=13(a+b+c)(12(ab)2+12(bc)2+12(ca)2)=16(a+b+c)((ab)2+(bc)2+(ca)2)0\begin{aligned} \dfrac{1}{3}(x+y+z) - \sqrt[3]{xyz} &= \dfrac{1}{3} (a^3 + b^3 + c^3 - 3abc) \\ &= \dfrac{1}{3}((a+b)(a^2-ab+b^2) + c^3 - 3abc)\\ &= \dfrac{1}{3}((a+b+c)(a^2-ab+b^2) + c^3 - 3abc - a^2c + abc - b^2c) \\ &= \dfrac{1}{3}((a+b+c)(a^2-ab+b^2) + c(c^2 - 2ab - a^2 - b^2)) \\ &= \dfrac{1}{3}((a+b+c)(a^2-ab+b^2) - c((a + b)^2 - c^2)) \\ &= \dfrac{1}{3}((a+b+c)(a^2-ab+b^2) - c(a + b + c)(a + b - c)) \\ &= \dfrac{1}{3}(a+b+c)(a^2-ab+b^2 - c(a+b-c)) \\ &= \dfrac{1}{3}(a+b+c)(a^2 + b^2 + c^2 - (ab + bc + ca)) \\ &= \dfrac{1}{3}(a+b+c)\left(\dfrac{1}{2}(a - b)^2 + \dfrac{1}{2}(b - c)^2 + \dfrac{1}{2}(c - a)^2\right) \\ &= \dfrac{1}{6}(a+b+c)((a-b)^2 + (b-c)^2 + (c-a)^2) \\ &\ge 0 \end{aligned}

Hence xyz313(x+y+z)\sqrt[3]{xyz} \le \frac{1}{3}(x + y + z), which is strict unless a=b=ca = b = c, i.e. x=y=zx = y = z.

Problem Set 1.3

  1. Find the linear combination 3s1+4s2+5s3=b3\boldsymbol{s}_1 + 4\boldsymbol{s}_2 + 5\boldsymbol{s}_3 = \boldsymbol{b}. Then write b\boldsymbol{b} as a matrix-vector multiplication SxS \boldsymbol{x}, with 33, 44, 55 in x\boldsymbol{x}. Compute the three dot products (row of SS) x\cdot\,\, \boldsymbol{x}:

    s1=[111],s2=[011],s3=[001]go into the columns of S.\boldsymbol{s}_1 = \begin{bmatrix*}[r] 1 \\ 1 \\ 1\end{bmatrix*}, \quad \boldsymbol{s}_2 = \begin{bmatrix*}[r] 0 \\ 1 \\ 1\end{bmatrix*}, \quad \boldsymbol{s}_3 = \begin{bmatrix*}[r] 0 \\ 0 \\ 1\end{bmatrix*} \quad \text{go into the columns of } S.

Solutionb=3s1+4s2+5s3=3[111]+4[011]+5[001]=[3712]\boldsymbol{b} = 3\boldsymbol{s}_1 + 4\boldsymbol{s}_2 + 5\boldsymbol{s}_3 = 3\begin{bmatrix*}[c] 1 \\ 1 \\ 1\end{bmatrix*} + 4\begin{bmatrix*}[c] 0 \\ 1 \\ 1\end{bmatrix*} + 5\begin{bmatrix*}[c] 0 \\ 0 \\ 1\end{bmatrix*} = \begin{bmatrix*}[c] 3 \\ 7 \\ 12\end{bmatrix*}

b=Sx=[100110111] ⁣[345]=[(1,0,0)(3,4,5)(1,1,0)(3,4,5)(1,1,1)(3,4,5)]=[13+04+0513+14+0513+14+15]=[3712]\boldsymbol{b} = S \boldsymbol{x} = \begin{bmatrix*} 1 & 0 & 0 \\ 1 & 1 & 0 \\ 1 & 1 & 1\end{bmatrix*} \negthinspace \begin{bmatrix*}3 \\ 4 \\ 5\end{bmatrix*} = \begin{bmatrix*}(1, 0, 0) \cdot (3, 4, 5) \\ (1, 1, 0) \cdot (3, 4, 5) \\ (1, 1, 1) \cdot (3, 4, 5) \end{bmatrix*} = \begin{bmatrix*}1 \cdot 3 + 0 \cdot 4 + 0 \cdot 5 \\ 1 \cdot 3 + 1 \cdot 4 + 0 \cdot 5 \\ 1 \cdot 3 + 1 \cdot 4 + 1 \cdot 5 \end{bmatrix*} = \begin{bmatrix*} 3 \\ 7 \\ 12 \end{bmatrix*}

  1. The last lines of the Worked Example say that the 4 by 4 centered difference matrix in (16) is invertible. Solve Cx=(b1,b2,b3,b4)C \boldsymbol{x} = (b_1, b_2, b_3, b_4) to find its inverse in x=C1b\boldsymbol{x} = C^{-1} \boldsymbol{b}.

Solution Since

Cx=[0100101001010010][x1x2x3x4]=[x2.x1x3x1x4x2x4x3]=[b1b2b3b4]C \boldsymbol{x} = \begin{bmatrix*}0 & 1 & 0 & 0 \\ -1 & 0 & 1 & 0 \\ 0 & -1 & 0 & 1 \\ 0 & 0 & -1 & 0\end{bmatrix*}\begin{bmatrix*}x_1 \\ x_2 \\ x_3 \\ x_4\end{bmatrix*} = \begin{bmatrix*}x_2\hphantom{.- x_1} \\ x_3-x_1 \\ x_4-x_2 \\ \hphantom{x_4}-x_3\end{bmatrix*} = \begin{bmatrix*}b_1 \\ b_2 \\ b_3 \\ b_4\end{bmatrix*}

we have

x=[x1x2x3x4]=[b2b4b1b4b4b4b1+b3]=[0101100000011010][b1b2b3b4]\boldsymbol{x} = \begin{bmatrix*}x_1 \\ x_2 \\ x_3 \\ x_4\end{bmatrix*} = \begin{bmatrix*} {}- b_2 - b_4 \\ \hphantom{-}b_1\hphantom{-b_4} \\ \hphantom{ {}-b_4}-b_4 \\ \hphantom{ {}-{} }b_1 + b_3\end{bmatrix*} = \begin{bmatrix*}0 & -1 & 0 & -1 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & -1 \\ 1 & 0 & 1 & 0\end{bmatrix*}\begin{bmatrix*}b_1 \\ b_2 \\ b_3 \\ b_4\end{bmatrix*}

which implies that

C1=[0101100000011010]C^{-1} = \begin{bmatrix*}0 & -1 & 0 & -1 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & -1 \\ 1 & 0 & 1 & 0\end{bmatrix*}

  1. If (a,b)(a, b) is a multiple of (c,d)(c, d) with abcd0abcd \ne 0, show that (a,c)(a, c) is a multiple of (b,d)(b, d). This is surprisingly important; two columns are falling on one line. You could use numbers first to see how aa, bb, cc, dd are related. The question will lead to: If [abcd]\begin{bmatrix} a & b \\ c & d \end{bmatrix} has dependent rows, then it also has dependent columns.

Proof Let (a,b)=λ(c,d)(a, b) = \lambda(c, d) with λ0\lambda \ne 0, i.e. a=λca = \lambda c and b=λdb = \lambda d. Then (a,c)=(a,1λa)(a, c) = (a, \frac{1}{\lambda}a) and (b,d)=(b,1λb)(b, d) = (b, \frac{1}{\lambda}b). Since abcd0abcd \ne 0, let a=μba = \mu b with μ0\mu \ne 0. Then (a,c)=(μb,μλb)=μ(b,1λb)=μ(b,d)(a, c) = \left(\mu b, \frac{\mu}{\lambda}b\right) = \mu \left(b, \frac{1}{\lambda}b\right) = \mu(b, d), which shows that (a,c)(a, c) is a multiple of (b,d)(b, d).

GSLA Chapter 2 Problem Set (Optional)
Dijkstra 算法正确性的证明