Linear Algebra and Its Applications, Exercise 3.2.8

Exercise 3.2.8. Consider a tetrahedon representing the methane molecule CH4, with vertices (hydrogen atoms) at \left(0,0,0\right), \left(1,1,0\right), \left(1,0,1\right), and \left(0,1,1\right), and the center (carbon atom) at \left(\frac{1}{2},\frac{1}{2},\frac{1}{2}\right). What is the cosine of the angle between the rays going from the center to each of the vertices?

Answer: Let a be the ray from \left(\frac{1}{2},\frac{1}{2},\frac{1}{2}\right) to \left(0,0,0\right) and b be the ray from \left(\frac{1}{2},\frac{1}{2},\frac{1}{2}\right) to \left(1,1,0\right). We have

a = \left(0,0,0\right) - \left(\frac{1}{2},\frac{1}{2},\frac{1}{2}\right) = \left(-\frac{1}{2},-\frac{1}{2},-\frac{1}{2}\right)

b = \left(1,1,0\right) - \left(\frac{1}{2},\frac{1}{2},\frac{1}{2}\right) = \left(\frac{1}{2},\frac{1}{2},-\frac{1}{2}\right)

a^Tb = -\frac{1}{2} \cdot \frac{1}{2} - \frac{1}{2} \cdot \frac{1}{2} - \frac{1}{2} \cdot (-\frac{1}{2})

= -\frac{1}{4} - \frac{1}{4} + \frac{1}{4} = -\frac{1}{4}

\|a\| = \sqrt{\left(-\frac{1}{2}\right)^2+\left(-\frac{1}{2}\right)^2+\left(-\frac{1}{2}\right)^2}

= \sqrt{\frac{1}{4}+\frac{1}{4}+\frac{1}{4}} = \sqrt{\frac{3}{4}} = \frac{\sqrt{3}}{2}

\|b\| = \sqrt{\left(\frac{1}{2}\right)^2+\left(\frac{1}{2}\right)^2+\left(-\frac{1}{2}\right)^2}

= \sqrt{\frac{1}{4}+\frac{1}{4}+\frac{1}{4}} = \sqrt{\frac{3}{4}} = \frac{\sqrt{3}}{2}

We can then compute the cosine of the angle \theta between a and b as

\cos \theta = a^Tb/\|a\|\|b\| = -\frac{1}{4}/\left(\frac{\sqrt{3}}{2} \cdot \frac{\sqrt{3}}{2}\right)

= -\frac{1}{4}/\left(\frac{3}{4}\right) = -\frac{1}{4} \cdot \frac{4}{3} = -\frac{1}{3}

The cosines of the angles between the other rays have the same value; this can be easily demonstrated using similar steps to those shown above.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Tagged , , , | Leave a comment

Linear Algebra and Its Applications, Exercise 3.2.7

Exercise 3.2.7. Show that \left(a_1 + \dots + a_n\right)^2 \le n\left(a_1^2 + \dots + a_n^2\right). Hint: use the Schwarz inequality |a^Tb| \le \|a\|\|b\| with an appropriate choice of b.

Answer: As noted in the hint, the key to proving this is to find an appropriate choice of b. The easiest way to do this is to work backwards from the statement \left(a_1 + \dots + a_n\right)^2 \le n\left(a_1^2 + \dots + a_n^2\right) that we want to prove.

First, note that \left(a_1^2 + \dots + a_n^2\right) = \|a\|^2. Since the expression n\left(a_1^2 + \dots + a_n^2\right) is on the right  side of the inequality we wish to prove, and the expression \|a\|\|b\| = \|b\|\|a\| is on the right side of the Schwarz inequality, this suggests that we should choose b so that n\left(a_1^2 + \dots + a_n^2\right) = \|b\|^2\|a\|^2, or n = \|b\|^2 .

Second, since the expression \|b\|^2 \|a\|^2 = \left(\|a\|\|b\|\right)^2 is the square of the expression on the right side of the Schwarz inequality, this suggests that we should choose b so that\left(a_1+\dots+a_n\right)^2 is the square of the expression |a^Tb| on the left side of the Schwarz inequality, so that |a^Tb| = |a_1+\dots+a_n|. Since a^Tb = a_1b_1 + \dots + a_nb_n this suggests that we choose b = \left(1, \dots, 1\right).

With this choice of b the proof is simple. If we take the Schwarz inequality |a^Tb| \le \|a\|\|b\| and square both sides we obtain |a^Tb|^2 \le \left(\|a\|\|b\|\right)^2. If b = \left(1, \dots, 1\right) then a^Tb = a_1+\dots+a_n as noted earlier. Whether a^Tb is positive or negative squaring it produces the same result, so that |a^Tb|^2 = \left(a^Tb\right)^2 = \left(a_1+\dots+a_n\right)^2 on the left hand side of the inequality.

If If b = \left(1, \dots, 1\right) then \|b\|^2 = \sum_{i=1}^n 1^2 = n so that we have \left(\|a\|\|b\|\right)^2 = \|b\|^2\|a\|^2 = n\left(a_1^2+\dots+a_n^2\right) on the right hand side of the inequality.

Combining the left and right sides of the inequality we then have \left(a_1 + \dots + a_n\right)^2 \le n\left(a_1^2 + \dots + a_n^2\right).

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Tagged | Leave a comment

Linear Algebra and Its Applications, Exercise 3.2.6

Exercise 3.2.6. Suppose that a and b are unit vectors. Then a one-line proof of the Schwarz inequality is as follows:

|a^Tb| = |\sum a_jb_j| \le \sum |a_j||b_j| \le \sum \frac{1}{2} \left(|a_j|^2+|b_j|^2\right) = \frac{1}{2} + \frac{1}{2} = \|a\|\|b\|

What previous exercise justifies the middle step of this proof?

Answer: From exercise 3.2.1(a) we have \sqrt{xy} \le \frac{1}{2}\left(x+y\right) for any positive x and y.  We can easily extend this result to any non-negative x and y: If x = 0 then \sqrt{xy} = \sqrt{0} = 0 and \frac{1}{2} \left(x+y\right) = \frac{1}{2} y \ge 0 as long as y \ge 0. So \sqrt{xy} \le \frac{1}{2}\left(x+y\right) if x = 0 and y \ge 0. A similar argument shows that \sqrt{xy} \le \frac{1}{2}\left(x+y\right) if x \ge 0 and y = 0. Combined with the previous result this shows that \sqrt{xy} \le \frac{1}{2}\left(x+y\right) for all x \ge 0 and y \ge 0.

Let x = |a_j|^2 \ge 0 and y = |b_j|^2 \ge 0. We then have \sqrt{|a_j|^2|b_j|^2} \le \frac{1}{2}\left(|a_j|^2+|b_j|^2\right) or |a_j||b_j| \le \frac{1}{2}\left(|a_j|^2+|b_j|^2\right). This is the middle step of the one-line proof of the Schwarz inequality shown above.

Note that exercise 3.2.1(a) actually used the Schwarz inequality to prove that \sqrt{xy} \le \frac{1}{2}\left(x+y\right), so strictly speaking the above proof is circular. To remedy this we can prove the result from exercise 3.2.1(a) without using the Schwarz inequality. The proof (adapted from Wikipedia) is as follows:

We know that \left(x-y\right)^2 \ge 0 for any x and y. Expanding the lefthand side we have \left(x-y\right)^2 = x^2 -2xy + y^2. Substituting into the inequality we have x^2 -2xy + y^2 \ge 0 or 2xy \le x^2 + y^2. Adding 2xy to both sides of the inequality we have 2xy + 2xy \le x^2 + 2xy+ y^2 or 4xy \le \left(x+ y\right)^2. If x \ge 0 and y \ge 0 then xy \ge 0 and we can take the square root of both sides of the inequality to obtain 2\sqrt{xy} \le \left(x+ y\right) or \sqrt{xy} \le \frac{1}{2}\left(x+y\right).

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Tagged , , | Leave a comment

Linear Algebra and Its Applications, Exercise 3.2.5

Exercise 3.2.5. If a = (1, 1, \dots, 1) is a vector in \mathbb{R}^n then what is the angle \theta between a and the coordinate axes? What is the matrix P that projects vectors in \mathbb{R}^n onto a?

Answer: Consider the i^{th} coordinate axis and the unit vector e_i lying along that axis, whose i^{th} entry is 1 and whose other entries are zero. If \theta is the angle between a and e_i then we have \cos \theta = a^Te_i / \|a\|\|e_i\|. We have \|e_i\| = 1 and \|a\|^2 = \sum_{j=1}^n 1^2 = n so that \|a\| = \sqrt{n}. We also have a^Te_i = 1 since the i^{th} entries of a and e_i are both 1 and all other entries of e_i are zero.

We thus have \cos \theta = a^Te_i / \|a\|\|e_i\| = 1/\sqrt{n} so that \theta = \arccos 1/\sqrt{n}.

The matrix P that projects vectors in \mathbb{R}^n onto a is

P = aa^T/a^Ta = \frac{1}{a^Ta}(aa^T) = \frac{1}{n} \begin{bmatrix} 1 \\ \vdots \\ 1 \end{bmatrix} \begin{bmatrix} 1&\cdots&1 \end{bmatrix}

= \frac{1}{n} \begin{bmatrix} 1&\cdots&1 \\ \vdots&\ddots&\vdots \\ 1&\cdots&1 \end{bmatrix} = \begin{bmatrix} \frac{1}{n}&\cdots&\frac{1}{n} \\ \vdots&\ddots&\vdots \\ \frac{1}{n}&\cdots&\frac{1}{n} \end{bmatrix}

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Tagged | Leave a comment

Linear Algebra and Its Applications, Exercise 3.2.4

Exercise 3.2.4. Show that the Schwarz inequality |a^Tb| \le \|a\|\|b\| is an equality if and only if a and b are on the same line through the origin. Describe the situation if a and b are on the opposite sides of the origin.

Answer: We assume that both a and b are nonzero. (If either a = 0 or b = 0 then a^Tb = 0 and either \|a\| = 0 or \|b\| = 0 so that \|a\|\|b\| = 0. So in this case it is trivially true that |a^Tb| = \|a\|\|b\|.) We first show that if |a^Tb| = \|a\|\|b\| then a and b are on the same line through the origin.

If |a^Tb| = \|a\|\|b\| then we have |a^Tb| / \|a\|\|b\| = 1. (We can do the division because per our assumption above both a and b are nonzero and thus the product of their lengths is nonzero.) The denominator is always positive, but the numerator can be either positive or negative. If it is positive then we have a^Tb / \|a\|\|b\| = 1 and if it is negative then we have a^Tb / \|a\|\|b\| = -1. But a^Tb / \|a\|\|b\| = \cos \theta where \theta is the angle between a and b, so we have either \cos \theta = 1 or \cos \theta = -1.

In the former case the angle \theta = 0 (or more generally, \theta = 360^{\circ} \cdot n for some integer n), and a and b lie on the same line through the origin, on the same side of the origin. In the latter case the angle \theta = 180^{\circ} (or more generally, \theta = 180^{\circ} + 360^{\circ} \cdot n for some integer n), and a and b lie on the same line through the origin, but on the opposite side of the origin.

We next show that if a and b are on the same line through the origin  then |a^Tb| = \|a\|\|b\|.

If a and b lie on the same line through the origin, on the same side of the origin, then the angle \theta between a and b is 0. We then have 1 = \cos \theta = a^Tb / \|a\|\|b\| so that a^Tb = \|a\|\|b\|. If a and b lie on the same line through the origin, on the opposite side of the origin, then the angle \theta between a and b is 180^{\circ}. We then have -1 = \cos \theta = a^Tb / \|a\|\|b\| so that -a^Tb = \|a\|\|b\|. Combining the two equations we have |a^Tb| = \|a\|\|b\|.

We have thus shown that |a^Tb| = \|a\|\|b\| if and only if a and b are on the same line through the origin.

As implied by the equations above, if a and b lie on the same line through the origin, on the opposite side of the origin, then \|a\|\|b\| = -a^Tb and the value a^Tb is negative.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Tagged | Leave a comment

Linear Algebra and Its Applications, Exercise 3.2.3

Exercise 3.2.3. Find the multiple of the vector a = \left(1, 1, 1\right) that is closest to the point b = \left(2, 4, 4\right). Also find the point on the line through b that is closest to a.

Answer: The first problem amounts to finding the projection p of b onto a. From formula (5) on page 147 (theorem 3H) we have p = \left(a^Tb/a^Ta\right)a.

Given the definitions of a and b we then have

a^Tb = 1 \cdot 2 + 1 \cdot 4 + 1 \cdot 4 = 2+4+4 = 10

a^Ta = 1 \cdot 1 + 1 \cdot 1 + 1 \cdot 1 = 1+1+1 = 3

We thus have p = \frac{10}{3}a with \frac{10}{3} being the multiple of a we were asked to find.

The second problem amounts to finding the projection q of a onto b. Adapting formula (5) we have q = \left(b^Ta/b^Tb\right)b.

Given the definitions of a and b we then have

b^Ta = a^Tb = 10

b^Tb = 2 \cdot 2 + 4 \cdot 4 + 4 \cdot 4 = 4+16+16 = 36

We thus have q = \frac{10}{36}b = \frac{5}{18}b or

q = \left(\frac{5}{18} \cdot 2, \frac{5}{18} \cdot 4, \frac{5}{18} \cdot 4\right) = \left(\frac{5}{9}, \frac{10}{9}, \frac{10}{9}\right)

so that \left(\frac{5}{9}, \frac{10}{9}, \frac{10}{9}\right) is the point on the line through b we were asked to find.

UPDATE: Fixed the computation of b^Tb and thus of q. Thanks to Ann and universitypika for the correction.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Tagged | 4 Comments

Linear Algebra and Its Applications, Exercise 3.2.2

Exercise 3.2.2. Use the formula p = \bar{x}a = \left(a^Tb/a^Ta\right)a (where p is the projection of b on a) to confirm that \|p\| = \|b\||\cos \theta| (where \theta is the angle between a and b).

Answer: Since p = \left(a^Tb/a^Ta\right)a we can compute the square of the length of p as

\|p\|^2 = \left[\left(a^Tb/a^Ta\right)a\right]^T \left[\left(a^Tb/a^Ta\right)a\right]

Since \left(a^Tb/a^Ta\right) is a scalar quantity we can bring it out of the transpose expression and then bring it to the left of the expression:

\|p\|^2 = \left[\left(a^Tb/a^Ta\right)a\right]^T \left[\left(a^Tb/a^Ta\right)a\right]

= \left(a^Tb/a^Ta\right) a^T \left(a^Tb/a^Ta\right) a

= \left(a^Tb/a^Ta\right) \left(a^Tb/a^Ta\right) a^Ta

= \left(a^Tb/a^Ta\right)^2 a^Ta

This leaves us with the scalar quantity a^Ta at the right, so we can further simplify this expression as follows:

\|p\|^2 = \left(a^Tb/a^Ta\right)^2 a^Ta = \left(a^Tb\right)^2 a^Ta / \left(a^Ta\right)^2

= \left(a^Tb\right)^2 / a^Ta = \left(a^Tb\right)^2/\|a\|^2

Taking the positive square root of both sides we then have

\|p\| = |a^Tb/\|a\||

At the same time from (2) on page 146 (theorem 3G) we have

\cos \theta = a^Tb/\left(\|a\|\|b\|\right)

so that

\|b\|\cos \theta = a^Tb/\|a\|

Substituting into the above expression for p we then have

\|p\| = |a^Tb/\|a\|| = |\|b\|\cos \theta| = \|b\||\cos \theta|

(since \|b\| is guaranteed to be positive but \cos \theta is not).

UPDATE: I expanded the derivation above in response to a question posted on MathHub.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Tagged | 1 Comment

Linear Algebra and Its Applications, Exercise 3.2.1

Exercise 3.2.1. a) Consider the vectors a = \left( \sqrt{y}, \sqrt{x} \right) and b = \left( \sqrt{x}, \sqrt{y} \right) where x and y are arbitrary positive real numbers. Use the Schwarz inequality involving a and b to derive a relationship between the arithmetic mean \frac{1}{2}\left(x+y\right) and the geometric mean \sqrt{xy}.

b) Consider a vector from the origin to point x, a second vector of length \|y\| from x to the point x+y and the third vector from the origin to x+y. Using the triangle inequality

\|x+y\| \le \|x\| + \|y\|

derive the Schwarz inequality. (Hint: Square both sides of the inequality and expand the expression \left( x+y \right)^T\left( x+y \right).)

Answer: a) From the Schwarz inequality we have

|a^Tb| \le \|a\| \|b\|

From the definitions of a and b, on the left side of the inequality we have

|a^Tb| = |\sqrt{y} \sqrt{x} + \sqrt{x} \sqrt{y}|

= |\sqrt{yx} + \sqrt{xy}| = 2|\sqrt{xy}| = 2\sqrt{xy}

assuming we always choose the positive square root.

From the definitions of a and b we also have

\|a\|^2 = \left( \sqrt{y} \right)^2 + \left( \sqrt{x} \right)^2 = y + x = x+y

and

\|b\|^2 = \left( \sqrt{x} \right)^2 + \left( \sqrt{y} \right)^2 = y + x = x+y

so that the right side of the inequality is

\|a\|\|b\| = \sqrt{x+y} \sqrt{x+y}

= \sqrt{\left(x+y\right)^2} = x+y

again assuming we choose the positive square root. (We know x+y is positive since both x and y are.)

The Schwartz inequality

|a^Tb| \le \|a\| \|b\|

then becomes

2\sqrt{xy} \le x+y

or (dividing both sides by 2)

\sqrt{xy} \le \frac{1}{2}\left( x+y \right)

We thus see that for any positive real numbers x and y the geometric mean \sqrt{xy} is less than the arithmetic mean \frac{1}{2}\left(x+y\right).

b) From the triangle inequality we have

\|x+y\| \le \|x\| + \|y\|

for the vectors x and y. Squaring the term on the left side of the inequality and using the commutative and distributive properties of the inner product we obtain

\|x+y\|^2 = \left( x+y \right)^T \left( x+y \right)

= x^T \left( x+y \right) + y^T \left( x+y \right)

= x^Tx + x^Ty + y^Tx + y^Ty

= x^Tx + 2x^Ty + y^Ty

= \|x\|^2 + 2x^Ty + \|y\|^2

Squaring the term on the right side of the inequality we have

\left( \|x\| + \|y\| \right)^2 = \|x\|^2 + 2\|x\|\|y\| + \|y\|^2

The inequality

\|x+y\| \le \|x\| + \|y\|

is thus equivalent to the inequality

\|x\|^2 + 2x^Ty + \|y\|^2 \le \|x\|^2 + 2\|x\|\|y\| + \|y\|^2

Subtracting \|x\|^2 and \|y\|^2 from both sides of the inequality gives us

2x^Ty \le 2\|x\|\|y\|

and dividing both sides of the inequality by 2 produces

x^Ty \le \|x\|\|y\|

Note that this is almost but not quite the Schwarz inequality: Since the Schwarz inequality involves the absolute value |x^Ty| we must also prove that

-x^Ty \le \|x\|\|y\|

(After all, the inner product x^Ty might be negative, in which case the inequality x^Ty \le \|x\|\|y\| would be trivially true, given that the term on the right side of the inequality is guaranteed to be positive.)

We have -x^Ty = \left(-x\right)^Ty. Since the triangle inequality holds for any two vectors we can restate it in terms of -x and y as follows:

\|\left(-x\right)+y\| \le \|-x\| + \|y\|

Since \|-x\| = \|x\| squaring the term on the right side of the inequality produces

\left(\|-x\| + \|y\|\right)^2 = \left(\|x\| + \|y\|\right)^2 = \|x\|^2 + 2\|x\|\|y\| + \|y\|^2

as it did previously. However squaring the term on the left side of the inequality produces

\|\left(-x\right)+y\|^2 = \left( -x+y \right)^T \left( -x+y \right)

= \left(-x\right)^T \left( -x+y \right) + y^T \left( -x+y \right)

= \left(-x\right)^T\left(-x\right) + \left(-x\right)^Ty + y^T\left(-x\right) + y^Ty

= x^Tx - x^Ty - y^Tx + y^Ty = x^Tx - 2x^Ty + y^Ty

= \|x\|^2 - 2x^Ty + \|y\|^2

The original triangle inequality

\|\left(-x\right)+y\| \le \|-x\| + \|y\|

is thus equivalent to

\|x\|^2 - 2x^Ty + \|y\|^2 \le \|x\|^2 + 2\|x\|\|y\| + \|y\|^2

or

-x^Ty \le \|x\|\|y\|

Since we have both -x^Ty \le \|x\|\|y\| and x^Ty \le \|x\|\|y\| we therefore have

|x^Ty| \le \|x\|\|y\|

which is the Schwarz inequality.

So the triangle inequality implies the Schwarz inequality.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Tagged , , , | Leave a comment

Commutative and distributive properties for vector inner products

As I think I’ve previously mentioned, one of the minor problems with Gilbert Strang’s book Linear Algebra and Its Applications, Third Edition, is that frequently Strang will gloss over things that in a more rigorous treatment really should be explicitly proved.

In particular, Strang seems to assume and then subsequently use (e.g., in his proof of the Schwarz inequality) the following commutative and distributive properties for vector inner products:

x^Ty = y^Tx

x^T(y+z) = x^Ty + x^Tz

The proofs of these are simple, and rely on the commutative and distributive properties of standard addition and multiplication for real numbers:

Let x, y and z be vectors in \mathbb{R}^n, so that x = \left(x_1, \dots, x_n\right), y = \left(y_1, \dots, y_n\right) and z = \left(z_1, \dots, z_n\right) where all x_i, y_i and z_i are real numbers.

By the definition of the inner product and the commutative property of standard multiplication for real numbers we have

x^Ty = \sum_{i=1}^n x_iy_i = \sum_{i=1}^n y_ix_i = y^Tx

By the definition of the inner product and the distributive property of standard addition and multiplication for real numbers we have

x^T(y+z) = \sum_{i=1}^n x_i\left(y_i+z_i\right)

= \sum_{i=1}^n \left(x_iy_i+x_iz_i\right)

= \sum_{i=1}^n x_iy_i + \sum_{i=1}^n x_iz_i = x^Ty + x^Tz

Note that by combining the commutative and distributive properties proved above we also have

\left(y+z\right)^Tx = x^T\left(y+z\right)

x^Ty + x^Tz = y^Tx + z^Tx

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Tagged , , | Leave a comment

Linear Algebra and Its Applications, Exercise 3.1.22

Exercise 3.1.22. Consider the equation x_1+x_2+x_3+x_4 = 0 and the subspace S of \mathbb{R}^n containing all vectors that satisfy it. Find a basis for S^\perp, the orthogonal complement of S.

Answer:  S is the nullspace of the linear system Ax = 0 where

A = \begin{bmatrix} 1&1&1&1 \end{bmatrix}

Since S is the nullspace of A its orthogonal complement S^\perp is the row space of A, which is spanned by the vector (1, 1, 1, 1) (the first and only row of A). The vector

\begin{bmatrix} 1 \\ 1 \\ 1 \\ 1 \end{bmatrix}

is thus a basis for S^\perp.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

 Buy me a snack to sponsor more posts like this!

Posted in linear algebra | Tagged | Leave a comment