Steply

Gram-Schmidt

Linear Algebra ยท 21 problems, easy to harder

โ–ถ Watch the first one solved

How we do it

  1. Keep the first
  2. Make the second one perpendicular
  3. Make the third one perpendicular
  4. Check

The steps for Orthogonal basis from (1, 1, 0), (1, 0, 1), (0, 1, 1). Every solution names its steps, so you always know what comes next.

Worked examples

Gram-Schmidt on (1, 1), (1, 0) Easy

The question

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

v1 = [1; 1], v2 = [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 = [1; 1]

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 ร— 1 + 0 ร— 1 = 1 + 0 = 1

The bottom: uโ‚ โ€ข uโ‚.

u1 โ€ข u1 = 1 ร— 1 + 1 ร— 1 = 1 + 1 = 2

So the number is 1/2.

number = 12

Times uโ‚: every entry times 1/2.

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

proj on u1 = 12 ร— [1; 1] = [1 over 2; 1 over 2]

So uโ‚‚ is vโ‚‚ minus the projection.

u2 = [1; 0] โˆ’ [1 over 2; 1 over 2]

Entry by entry: (1/2, โˆ’1/2).

u2 = [1 over 2; โˆ’1 over 2]

To clear the fractions, we multiply it by 2.

Same direction, still at a right angle.

u2 = [1; โˆ’1]

So the orthogonal vectors are uโ‚ = (1, 1) and uโ‚‚ = (1, โˆ’1).

= u1 = [1; 1], u2 = [1; โˆ’1]

3 Check

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

uโ‚ โ€ข uโ‚‚.

u1 โ€ข u2 = 1 ร— 1 + 1 ร— (โˆ’1) = 1 โˆ’ 1 = 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 = [1; 1], u2 = [1; โˆ’1]

โ–ถ Watch it solved

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

The question

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

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

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 = [1; 1; 0]

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 ร— 1 + 0 ร— 1 + 1 ร— 0 = 1 + 0 + 0 = 1

The bottom: uโ‚ โ€ข uโ‚.

u1 โ€ข u1 = 1 ร— 1 + 1 ร— 1 + 0 ร— 0 = 1 + 1 + 0 = 2

So the number is 1/2.

number = 12

Times uโ‚: every entry times 1/2.

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

proj on u1 = 12 ร— [1; 1; 0] = [1 over 2; 1 over 2; 0]

So uโ‚‚ is vโ‚‚ minus the projection.

u2 = [1; 0; 1] โˆ’ [1 over 2; 1 over 2; 0]

Entry by entry: (1/2, โˆ’1/2, 1).

u2 = [1 over 2; โˆ’1 over 2; 1]

To clear the fractions, we multiply it by 2.

Same direction, still at a right angle.

u2 = [1; โˆ’1; 2]

So the orthogonal vectors are uโ‚ = (1, 1, 0) and uโ‚‚ = (1, โˆ’1, 2).

= u1 = [1; 1; 0], u2 = [1; โˆ’1; 2]

3 Check

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

uโ‚ โ€ข uโ‚‚.

u1 โ€ข u2 = 1 ร— 1 + 1 ร— (โˆ’1) + 0 ร— 2 = 1 โˆ’ 1 + 0 = 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 = [1; 1; 0], u2 = [1; โˆ’1; 2]

โ–ถ Watch it solved

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

The question

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

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

We want new vectors uโ‚, 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, u3 at right angles
(dot products 0), the same span

1 Keep the first

The first one stays: uโ‚ = vโ‚.

u1 = v1 = [1; 1; 0]

2 Make the second one perpendicular

uโ‚‚ is vโ‚‚ with its part along uโ‚ taken away.

u2 = v2 โˆ’ proj on u1

The part along uโ‚, as in the projection lesson.

The top: vโ‚‚ โ€ข uโ‚.

v2 โ€ข u1 = 1 ร— 1 + 0 ร— 1 + 1 ร— 0 = 1 + 0 + 0 = 1

The bottom: uโ‚ โ€ข uโ‚.

u1 โ€ข u1 = 1 ร— 1 + 1 ร— 1 + 0 ร— 0 = 1 + 1 + 0 = 2

So the number is 1/2.

number = 12

Times uโ‚: every entry times 1/2.

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

proj on u1 = 12 ร— [1; 1; 0] = [1 over 2; 1 over 2; 0]

So uโ‚‚ is vโ‚‚ minus the projection.

u2 = [1; 0; 1] โˆ’ [1 over 2; 1 over 2; 0]

Entry by entry: (1/2, โˆ’1/2, 1).

u2 = [1 over 2; โˆ’1 over 2; 1]

To clear the fractions, we multiply it by 2.

Same direction, still at a right angle.

u2 = [1; โˆ’1; 2]

3 Make the third one perpendicular

uโ‚ƒ is vโ‚ƒ with its parts along uโ‚ and uโ‚‚ taken away.

u3 = v3 โˆ’ proj on u1 โˆ’ proj on u2

Careful!

We project onto the new vectors uโ‚ and uโ‚‚, not onto the old ones.

Careful: project on the NEW u1, u2, not on v1, v2

The part along uโ‚, as in the projection lesson.

The top: vโ‚ƒ โ€ข uโ‚.

v3 โ€ข u1 = 0 ร— 1 + 1 ร— 1 + 1 ร— 0 = 0 + 1 + 0 = 1

The bottom: uโ‚ โ€ข uโ‚.

u1 โ€ข u1 = 1 ร— 1 + 1 ร— 1 + 0 ร— 0 = 1 + 1 + 0 = 2

So the number is 1/2.

number = 12

Times uโ‚: every entry times 1/2.

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

proj on u1 = 12 ร— [1; 1; 0] = [1 over 2; 1 over 2; 0]

Now the part along uโ‚‚.

The top: vโ‚ƒ โ€ข uโ‚‚.

v3 โ€ข u2 = 0 ร— 1 + 1 ร— (โˆ’1) + 1 ร— 2 = 0 โˆ’ 1 + 2 = 1

The bottom: uโ‚‚ โ€ข uโ‚‚.

u2 โ€ข u2 = 1 ร— 1 + (โˆ’1) ร— (โˆ’1) + 2 ร— 2 = 1 + 1 + 4 = 6

So the number is 1/6.

number = 16

Times uโ‚‚: every entry times 1/6.

The projection is (1/6, โˆ’1/6, 1/3).

proj on u2 = 16 ร— [1; โˆ’1; 2] = [1 over 6; โˆ’1 over 6; 1 over 3]

So uโ‚ƒ is vโ‚ƒ minus both projections.

u3 = [0; 1; 1] โˆ’ [1 over 2; 1 over 2; 0] โˆ’ [1 over 6; โˆ’1 over 6; 1 over 3]

Entry by entry: (โˆ’2/3, 2/3, 2/3).

u3 = [โˆ’2 over 3; 2 over 3; 2 over 3]

To clear the fractions, we multiply it by 3/2.

Same direction, still at a right angle.

u3 = [โˆ’1; 1; 1]

So the orthogonal vectors are uโ‚ = (1, 1, 0), uโ‚‚ = (1, โˆ’1, 2) and uโ‚ƒ = (โˆ’1, 1, 1).

= u1 = [1; 1; 0], u2 = [1; โˆ’1; 2], u3 = [โˆ’1; 1; 1]

4 Check

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

uโ‚ โ€ข uโ‚‚.

u1 โ€ข u2 = 1 ร— 1 + 1 ร— (โˆ’1) + 0 ร— 2 = 1 โˆ’ 1 + 0 = 0

uโ‚ โ€ข uโ‚ƒ.

u1 โ€ข u3 = 1 ร— (โˆ’1) + 1 ร— 1 + 0 ร— 1 = โˆ’1 + 1 + 0 = 0

uโ‚‚ โ€ข uโ‚ƒ.

u2 โ€ข u3 = 1 ร— (โˆ’1) + (โˆ’1) ร— 1 + 2 ร— 1 = โˆ’1 โˆ’ 1 + 2 = 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.

Then: make the third one perpendicular.

Last: check.

Answer
= u1 = [1; 1; 0], u2 = [1; โˆ’1; 2], u3 = [โˆ’1; 1; 1]

โ–ถ Watch it solved

Practice

Try each one, then open the answer. Stuck? Open the problem to watch every step.

Easy

  1. Gram-Schmidt on (1, 1), (1, 0)
    Answer
    = u1 = [1; 1], u2 = [1; โˆ’1]
  2. Gram-Schmidt on (1, 0), (2, 3)
    Answer
    = u1 = [1; 0], u2 = [0; 1]
  3. Gram-Schmidt on (3, 4), (1, 0)
    Answer
    = u1 = [3; 4], u2 = [4; โˆ’3]
  4. Gram-Schmidt on (1, 2), (3, 1)
    Answer
    = u1 = [1; 2], u2 = [2; โˆ’1]
  5. Gram-Schmidt on (2, 1), (1, 3)
    Answer
    = u1 = [2; 1], u2 = [โˆ’1; 2]
  6. Gram-Schmidt on (1, -1), (3, 1)
    Answer
    = u1 = [1; โˆ’1], u2 = [1; 1]

Medium

  1. orthogonal basis from (1, 1, 0), (1, 0, 1)
    Answer
    = u1 = [1; 1; 0], u2 = [1; โˆ’1; 2]
  2. orthogonal basis from (1, 0, 1), (2, 1, 0)
    Answer
    = u1 = [1; 0; 1], u2 = [1; 1; โˆ’1]
  3. orthogonal basis from (1, 2, 2), (3, 0, 3)
    Answer
    = u1 = [1; 2; 2], u2 = [2; โˆ’2; 1]
  4. orthogonal basis from (1, 1, 1), (1, 2, 3)
    Answer
    = u1 = [1; 1; 1], u2 = [โˆ’1; 0; 1]
  5. orthonormal basis from (3, 4), (1, 0)
    Answer
    = e1 = 15 ร— [3; 4], e2 = 15 ร— [4; โˆ’3]
  6. orthonormal basis from (1, 1), (1, 0)
    Answer
    = e1 = 1โˆš2 ร— [1; 1], e2 = 1โˆš2 ร— [1; โˆ’1]
  7. orthonormal basis from (1, 2, 2), (3, 0, 3)
    Answer
    = e1 = 13 ร— [1; 2; 2], e2 = 13 ร— [2; โˆ’2; 1]

Harder

  1. orthogonal basis from (1, 1, 0), (1, 0, 1), (0, 1, 1)
    Answer
    = u1 = [1; 1; 0], u2 = [1; โˆ’1; 2], u3 = [โˆ’1; 1; 1]
  2. Gram-Schmidt on (1, 0, 0), (1, 1, 0), (1, 1, 1)
    Answer
    = u1 = [1; 0; 0], u2 = [0; 1; 0], u3 = [0; 0; 1]
  3. orthogonal basis from (1, 1, 1), (1, 1, 0), (1, 0, 0)
    Answer
    = u1 = [1; 1; 1], u2 = [1; 1; โˆ’2], u3 = [1; โˆ’1; 0]
  4. orthogonal basis from (2, 1, 2), (1, 1, 0)
    Answer
    = u1 = [2; 1; 2], u2 = [1; 2; โˆ’2]
  5. orthogonal basis from (1, 0, 1), (1, 1, 0), (0, 1, 1)
    Answer
    = u1 = [1; 0; 1], u2 = [1; 2; โˆ’1], u3 = [โˆ’1; 1; 1]
  6. Gram-Schmidt on (2, 0), (1, 1)
    Answer
    = u1 = [2; 0], u2 = [0; 1]
  7. Gram-Schmidt on (1, 2), (2, 1)
    Answer
    = u1 = [1; 2], u2 = [2; โˆ’1]
  8. orthogonal basis from (1, -1, 0), (1, 0, 1)
    Answer
    = u1 = [1; โˆ’1; 0], u2 = [1; 1; 2]