Steply

Orthogonal basis from (2, 1, 2), (1, 1, 0)

Step by step, with the reason for every step · Gram-Schmidt · Linear Algebra

Step by step

The question

Question: make (2, 1, 2) and (1, 1, 0) orthogonal, with Gram-Schmidt.

v1 = [2; 1; 2], v2 = [1; 1; 0]

We want new vectors u₁ and u₂, each at a right angle to the others, that make the same vectors as the old ones.

The idea: take away from each vector the parts along the earlier ones.

goal: u1, u2 at right angles
(dot products 0), the same span

1 Keep the first

The first one stays: u₁ = v₁.

u1 = v1 = [2; 1; 2]

2 Make the second one perpendicular

u₂ is v₂ with its part along u₁ taken away.

u2 = v2 − proj on u1

Careful!

The projection is taken away from v₂, not added.

Careful: take the projection AWAY: v2 − proj

The part along u₁, as in the projection lesson.

The top: v₂ • u₁.

v2 • u1 = 1 × 2 + 1 × 1 + 0 × 2 = 2 + 1 + 0 = 3

The bottom: u₁ • u₁.

u1 • u1 = 2 × 2 + 1 × 1 + 2 × 2 = 4 + 1 + 4 = 9

So the number is 3/9, made simpler: 1/3.

number = 39 = 13

Times u₁: every entry times 1/3.

The projection is (2/3, 1/3, 2/3).

proj on u1 = 13 × [2; 1; 2] = [2 over 3; 1 over 3; 2 over 3]

So u₂ is v₂ minus the projection.

u2 = [1; 1; 0] − [2 over 3; 1 over 3; 2 over 3]

Entry by entry: (1/3, 2/3, −2/3).

u2 = [1 over 3; 2 over 3; −2 over 3]

To clear the fractions, we multiply it by 3.

Same direction, still at a right angle.

u2 = [1; 2; −2]

So the orthogonal vectors are u₁ = (2, 1, 2) and u₂ = (1, 2, −2).

= u1 = [2; 1; 2], u2 = [1; 2; −2]

3 Check

Let's check: every pair must have dot product 0.

u₁ • u₂.

u1 • u2 = 2 × 1 + 1 × 2 + 2 × (−2) = 2 + 2 − 4 = 0

Every dot product is 0: the vectors are at right angles.

So the answer is right!

Let's look back.

First: keep the first.

Then: make the second one perpendicular.

Last: check.

Answer
= u1 = [2; 1; 2], u2 = [1; 2; −2]

Your turn

Try this one yourself, then check:

Gram-Schmidt on [1; 3; 1], [1; 1; 0]
Show the answer
u1 = [1; 3; 1], u2 = [7; −1; −4]

More from Gram-Schmidt

The whole lesson: Gram-Schmidt →