Processing math: 72%
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

18.13: Movie Scripts 13-14

( \newcommand{\kernel}{\mathrm{null}\,}\)

G.13 Orthonormal Bases and Complements

All Orthonormal Bases for R2

We wish to find all orthonormal bases for the space R2, and they are {eθ1,eθ2} up to reordering where

eθ1=(cosθsinθ),eθ2=(sinθcosθ),

for some θ[0,2π). Now first we need to show that for a fixed θ that the pair is orthogonal:

eθ1eθ2=sinθcosθ+cosθsinθ=0.

Also we have

eθ12=eθ22=sin2θ+cos2θ=1,

and hence {eθ1,eθ2} is an orthonormal basis. To show that every orthonormal basis of R2 is {eθ1,eθ2} for some θ, consider an orthonormal basis {b1,b2} and note that b1 forms an angle ϕ with the vector e1 (which is e01). Thus b1=eϕ1 and if b2=eϕ2, we are done, otherwise b2=eϕ2 and it is the reflected version. However we can do the same thing except starting with b2 and get b2=eψ1 and b1=eψ2 since we have just interchanged two basis vectors which corresponds to a reflection which picks up a minus sign as in the determinant.

sin_cos_onb-page-001.jpg

A 4×4 Gram-Schmidt Example

Lets do an example of how to "Gram-Schmidt" some vectors in R4. Given the following vectors

v1=(o100),v2=(0110),v3=(3010), and v4=(1102),

we start with v1

v1=v1=(0100).

Now the work begins

v2=v2(v1v2)v12v1=(0110)11(0100)=(0010)

This gets a little longer with every step.

v3=v3(v1v3)v12v1(v2v3)v22v2=(3010)01(0100)11(0010)=(3000)

This last step requires subtracting off the term of the form uvuuu for each of the previously defined basis vectors.

v4=v4(v1v4)v12v1(v2v4)v22v2(v3v4)v32v3=(1102)11(0100)01(0010)39(3000)=(0002)

Now v1, v2, v3, and v4 are an orthogonal basis. Notice that even with very, very nice looking vectors we end up having to do quite a bit of arithmetic. This a good reason to use programs like matlab to check your work.

Another QR Decomposition Example

We can alternatively think of the QR decomposition as performing the Gram-Schmidt procedure on the column space, the vector space of the column vectors of the matrix, of the matrix M. The resulting orthonormal basis will be stored in Q and the negative of the coefficients will be recorded in R. Note that R is upper triangular by how Gram-Schmidt works. Here we will explicitly do an example with the matrix

M=(|||m1m2m3|||)=(111012111).

First we normalize m1 to get m1=m1m1 where m1=r11=2 which gives the decomposition

Q1=(12110121211),R1=(200010001).

Next we find

t2=m2(m1m2)m1=m2r12m1=m20m1

noting that

m1m1=m12=1

and t2=r22=3, and so we get m2=t2t2 with the decomposition

Q2=(12131013212131),R2=(200030001).

Finally we calculate

t3=m3(m1m3)m1(m2m3)m2=m3r13m1r23m2=m3+2m123m2,

again noting m2m2=m2=1, and let m3=t3t3 where t3=r33=223. Thus we get our final M=QR decomposition as

Q=(12131201323121316),R=(202032300223).

Overview

This video considers solutions sets for linear systems with three unknowns. These are often called (x,y,z) and label points in R3. Lets work case by case:

  1. If you have no equations at all, then any (x,y,z) is a solution, so the solution set is all of R3. The picture looks a little silly: (Fig1)
  2. For a single equation, the solution is a plane. The picture looks like this:​ (Fig2)
  3. For two equations, we must look at two planes. These usually intersect along a line, so the solution set will also (usually) be a line: (Fig3)
  4. For three equations, most often their intersection will be a single point so the solution will then be unique: (Fig4)
  5. Of course stuff can go wrong. Two different looking equations could determine the same plane, or worse equations could be inconsistent. If the equations are inconsistent, there will be no solutions at all. For example, if you had four equations determining four parallel planes the solution set would be empty. This looks like this: (Fig5)

all_of_R3.jpg

Fig1: R3

plane_in_R3.jpg

Fig2: Plane in R3

two_planes_in_R3.jpgthree_planes_in_R3.jpg

Fig3: Two Planes in R3 Fig4: Three Planes in R3

four_planes_in_R3.jpg

Fig5: Four Planes in R3

Hint for Review Question 2

You are asked to consider an orthogonal basis {v1,v2,vn}. Because this is a basis any vV can be uniquely expressed as

$$v=c^{1} v_{1} + c^{2} v_{2} +\cdots + v^{n} c_{n}\, ,\]

and the number n=dimV. Since this is an orthogonal basis

$$v_{i}\cdot v_{j} =0 \, ,\qquad i\neq j\, .\]

So different vectors in the basis are orthogonal:

rightangles.jpg

However, the basis is not orthonormal so we know nothing about the lengths of the basis vectors (save that they cannot vanish).

To complete the hint, lets use the dot product to compute a formula for c1 in terms of the basis vectors and v. Consider

$$v_{1}\cdot v = c^{1} v_{1}\cdot v_{1} + c^{2} v_{1}\cdot v^{2} +\cdots + c^{n} v_{1}\cdot v_{n}=c^{1} v_{1}\cdot v_{1}\, .\]

Solving for c1 (remembering that v1v10) gives

c1=v1vv1v1.

This should get you started on this problem.

Hint for Review Problem 3

Lets work part by part:

  1. Is the vector v()=vuvuuu in the plane P? Remember that the dot product gives you a scalar not a vector, so if you think about this formula uvuu is a scalar, so this is a linear combination of v and u. Do you think it is in the span?
  2. What is the angle between v and u? This part will make more sense if you think back to the dot product formulas you probably first saw in multivariable calculus. Remember that uv=uvcos(θ), and in particular if they are perpendicular θ=π2 and cos(π2)=0 you will get uv=0. Now try to compute the dot product of u and v to find uvcos(θ) uv=u(vuvuuu)=uvu(uvuu)u=uv(uvuu)uu Now you finish simplifying and see if you can figure out what θ has to be.
  3. Given your solution to the above, how can you find a third vector perpendicular to both u and v? Remember what other things you learned in multivariable calculus? This might be a good time to remind your self what the cross product does.
  4. Construct an orthonormal basis for 3 from u and v. If you did part (c) you can probably find 3 orthogonal vectors to make a orthogonal basis. All you need to do to turn this into an orthonormal basis is make these into unit vectors.
  5. Test your abstract formulae starting with u=(120) and v=(011). Try it out, and if you get stuck try drawing a sketch of the vectors you have.

Hint for Review Problem 10

This video shows you a way to solve problem 10 that's different to the method described in the lecture. The first thing is to think of M=(102120122) as a set of 3 vectors v1=(011),v2=(022),v3=(202). Then you need to remember that we are searching for a decomposition $$M = QR\]

where Q is an orthogonal matrix. Thus the upper triangular matrix R=QTM and QTQ=I. Moreover, orthogonal matrices perform rotations. To see this, compare the inner product uv=uTv of vectors u and v with that of Qu and Qv:

(Qu)\cdot (Qv) = (Qu)^{T}(Qv) = u^{T}Q^{T}Qv = u^{T}v = u\cdot v.

Since the dot product doesn't change, we learn that Q does not change angles or lengths of vectors. Now, here's an interesting procedure: rotate v_{1}, v_{2} and v_{3} such that v_{1} is along the x-axis, v_{2} is in the xy-plane. Then if you put these in a matrix you get something of the form

\begin{pmatrix}a & b & c \\ 0 & d & e \\ 0 & 0 & f\end{pmatrix}

which is exactly what we don't want for R!

Moreover, the vector

\begin{pmatrix}a\\0\\0\end{pmatrix}

is the rotated v_{1} so must have length ||v_{1}|| = \sqrt{3}. Thus a = \sqrt{3}. The rotated v_{2} is

\begin{pmatrix}b\\d\\0\end{pmatrix}

and must have length ||v_{2}|| = 2\sqrt{2}. Also the dot product between

\begin{pmatrix}a\\0\\0\end{pmatrix} \text{ and } \begin{pmatrix}b\\d\\0\end{pmatrix}

is ab and must equal v_{1}\cdot v_{2} = 0. (That v_{1} and v_{2} were orthogonal is just a coincidence here….). Thus b=0. So now we know most of the matrix R

R=\begin{pmatrix}\sqrt{3} & 0 & c \\ 0 & 2\sqrt{2} & e \\ 0 & 0 & f\end{pmatrix}

You can work out the last column using the same ideas. Thus it only remains to compute Q from

Q = MR^{-1}.

G.14 Diagonalizing Symmetric Matrices

3 \times 3 Example

Lets diagonalize the matrix

M =\begin{pmatrix}1 &2 & 0 \\2 & 1 & 0 \\0& 0 & 5 \\\end{pmatrix}

If we want to diagonalize this matrix, we should be happy to see that it is symmetric, since this means we will have real eigenvalues, which means factoring won't be too hard. As an added bonus if we have three distinct eigenvalues the eigenvectors we find will automatically be orthogonal, which means that the inverse of the matrix P will be easy to compute. We can start by finding the eigenvalues of this

\begin{eqnarray*}\det \begin{pmatrix}1-\lambda & 2 & 0 \\2 & 1 -\lambda& 0 \\0& 0 & 5-\lambda \\\end{pmatrix}&=& (1-\lambda)\begin{vmatrix}1 -\lambda& 0 \\0 & 5-\lambda \\\end{vmatrix}\\ & & - \, (2)\begin{vmatrix}2 & 0 \\0& 5-\lambda \\\end{vmatrix}+ 0 \begin{vmatrix}2 & 1 -\lambda \\0& 0 \\\end{vmatrix}\\&=&(1-\lambda)(1-\lambda)(5-\lambda)+ (-2)(2)(5-\lambda) +0\\&=&(1-2\lambda +\lambda^{2})(5-\lambda) + (-2)(2)(5-\lambda)\\&=&((1-4 )-2\lambda +\lambda^{2})(5-\lambda)\\&=&(-3-2\lambda +\lambda^{2})(5-\lambda)\\&=&(1+\lambda)(3-\lambda)(5-\lambda)\\\end{eqnarray*}

So we get \lambda = -1, 3, 5 as eigenvectors. First find v_{1} for \lambda_{1} = -1

(M+I)\begin{pmatrix}x\\y\\z\end{pmatrix}=\begin{pmatrix}2 &2 & 0 \\2 & 2& 0 \\0& 0 & 6 \\\end{pmatrix}\begin{pmatrix}x\\y\\z\end{pmatrix}= \begin{pmatrix}0\\0\\0\end{pmatrix},

implies that 2x+2y= 0 and 6z = 0, which means any multiple of v_{1} = \begin{pmatrix}1\\-1\\0\end{pmatrix} is an eigenvector with eigenvalue \lambda_{1} = -1. Now for v_{2} with \lambda_{2} = 3

(M-3I)\begin{pmatrix}x\\y\\z\end{pmatrix}=\begin{pmatrix}-2 &2 & 0 \\2 & -2& 0 \\0& 0 & 4 \\\end{pmatrix}\begin{pmatrix}x\\y\\z\end{pmatrix}= \begin{pmatrix}0\\0\\0\end{pmatrix},

and we can find that that v_{2} = \begin{pmatrix}1\\1\\0\end{pmatrix} would satisfy \(-2x+2y= 0, 2x-2y= 0 and 4z = 0.

Now for v_{3} with \lambda_{3} = 5

(M-5I)\begin{pmatrix}x\\y\\z\end{pmatrix}=\begin{pmatrix}-4 &2 & 0 \\2 & -4& 0 \\0& 0 & 0 \\\end{pmatrix}\begin{pmatrix}x\\y\\z\end{pmatrix}= \begin{pmatrix}0\\0\\0\end{pmatrix},

Now we want v_{3} to satisfy -4 x+ 2y = 0 and 2 x-4 y = 0, which imply x=y=0, but since there are no restrictions on the z coordinate we have v_{3} = \begin{pmatrix}0\\0\\1\end{pmatrix}.

Notice that the eigenvectors form an orthogonal basis. We can create an orthonormal basis by rescaling to make them unit vectors. This will help us because if P = [v_{1},v_{2},v_{3}] is created from orthonormal vectors then P^{-1}=P^{T}, which means computing P^{-1} should be easy. So lets say

v_{1} = \begin{pmatrix}\frac{1}{\sqrt{2}}\\-\frac{1}{\sqrt{2}}\\0\end{pmatrix}, \, v_{2} = \begin{pmatrix}\frac{1}{\sqrt{2}}\\\frac{1}{\sqrt{2}}\\0\end{pmatrix}, \text{ and } v_{3} = \begin{pmatrix}0\\0\\1\end{pmatrix}

so we get

P=\begin{pmatrix}\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}& 0\\-\frac{1}{\sqrt{2}} &\frac{1}{\sqrt{2}}& 0\\0&0 & 1\end{pmatrix} \text{ and }P^{-1}=\begin{pmatrix}\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}& 0\\\frac{1}{\sqrt{2}} &\frac{1}{\sqrt{2}}& 0\\0&0 & 1\end{pmatrix}

So when we compute D= P^{-1} M P we'll get

\begin{pmatrix}\frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}}& 0\\\frac{1}{\sqrt{2}} &\frac{1}{\sqrt{2}}& 0\\0&0 & 1\end{pmatrix}\begin{pmatrix}1 &2 & 0 \\2 & 5 & 0 \\0& 0 & 5 \\\end{pmatrix}\begin{pmatrix}\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}}& 0\\-\frac{1}{\sqrt{2}} &\frac{1}{\sqrt{2}}& 0\\0&0 & 1\end{pmatrix}= \begin{pmatrix}-1 &0 & 0 \\0 & 3 & 0 \\0& 0 & 5 \\\end{pmatrix}

Hint for Review Problem 1

For part (a), we can consider} any complex number z as being a vector in \mathbb{R}^{2} where complex conjugation corresponds to the matrix \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}. Can you describe z \bar{z} in terms of \norm{z}? For part (b), think about what values a \in \mathbb{R} can take if a = -a? Part (c), just compute it and look back at part (a).

For part (d), note that x^{\dagger} x is just a number, so we can divide by it. Parts (e) and (f) follow right from definitions. For part (g), first notice that every row vector is the (unique) transpose of a column vector, and also think about why (A A^{T})^{T} = A A^{T} for any matrix A. Additionally you should see that \overline{x^{T}} = x^{\dagger} and mention this. Finally for part (h), show that

\frac{x^{\dagger} M x}{x^{\dagger} x} = \overline{\left(\frac{x^{\dagger} M x}{x^{\dagger} x}\right)^{T}}

and reduce each side separately to get \lambda = \overline{\lambda}.

Contributor


This page titled 18.13: Movie Scripts 13-14 is shared under a not declared license and was authored, remixed, and/or curated by David Cherney, Tom Denton, & Andrew Waldron.

Support Center

How can we help?