Steply

Dot product and length

Linear Algebra ยท 22 problems, easy to harder

โ–ถ Watch the first one solved

How we do it

  1. Multiply matching entries
  2. Add them
  3. Check

The steps for Dot product of (1, 2, 3) and (4, -5, 6). Every solution names its steps, so you always know what comes next.

Worked examples

Dot product of (1, 2, 3) and (4, -5, 6) Easy

The question

Question: find the dot product of (1, 2, 3) and (4, โˆ’5, 6).

u = [1; 2; 3], v = [4; โˆ’5; 6]

The dot product u dot v: multiply matching entries, top with top and so on.

Then add them all.

The answer is one number.

u โ€ข v: matching entries multiplied, then added

1 Multiply matching entries

1 ร— 4 + 2 ร— (โˆ’5) + 3 ร— 6.

u โ€ข v = 1 ร— 4 + 2 ร— (โˆ’5) + 3 ร— 6

We work out each times.

u โ€ข v = 4 โˆ’ 10 + 18

2 Add them

Then we add: u โ€ข v = 12.

u โ€ข v = 12

Careful!

The dot product is one number, not a vector.

The products are added together.

Careful: one number, not a vector

3 Check

Let's check the other way round: v dot u.

The same products, so the same number.

v โ€ข u = 4 ร— 1 + (โˆ’5) ร— 2 + 6 ร— 3
= 4 โˆ’ 10 + 18 = 12

We get 12 again.

So the answer is right!

Let's look back.

First: multiply matching entries.

Then: add them.

Last: check.

Answer
Careful: one number, not a vector

โ–ถ Watch it solved

Are (1, 2, 3) and (1, 1, 1) orthogonal Medium

The question

Question: are (1, 2, 3) and (1, 1, 1) orthogonal?

u = [1; 2; 3], v = [1; 1; 1]

Orthogonal means perpendicular: at a right angle.

Two vectors are orthogonal exactly when their dot product is 0.

orthogonal: at a right angle (perpendicular)
u โ€ข v = 0

1 Find the dot product

Matching entries multiplied, then added: 1 ร— 1 + 2 ร— 1 + 3 ร— 1.

u โ€ข v = 1 ร— 1 + 2 ร— 1 + 3 ร— 1

We work out each times.

u โ€ข v = 1 + 2 + 3

Then we add: u โ€ข v = 6.

u โ€ข v = 6

2 Compare with 0

The dot product is 6, not 0.

So the vectors are not orthogonal.

= not orthogonal

Careful!

Only a dot product of exactly 0 means orthogonal.

Any other number, even a small one, means not.

Careful: orthogonal: the dot product is exactly 0

3 Check

Let's check with Pythagoras.

At a right angle, the length of u squared plus the length of v squared equals the length of u plus v, squared.

right angle: โ€–uโ€–2 + โ€–vโ€–2 = โ€–u + vโ€–2

The length squared is the entries squared, added.

For u: 14.

โ€–uโ€–ยฒ = 12 + 22 + 32 = 1 + 4 + 9 = 14

For v: 3.

โ€–vโ€–ยฒ = 12 + 12 + 12 = 1 + 1 + 1 = 3

u plus v: (2, 3, 4).

u + v = [2; 3; 4]

Its length squared: 29.

โ€–u + vโ€–ยฒ = 22 + 32 + 42 = 4 + 9 + 16 = 29

14 plus 3 is 17, not 29.

Pythagoras fails: no right angle.

So the answer is right!

14 + 3 = 17 โ‰  29

Let's look back.

First: find the dot product.

Then: compare with 0.

Last: check.

Answer
Careful: orthogonal: the dot product is exactly 0

โ–ถ Watch it solved

Are (3, -2, 1) and (1, 2, 1) perpendicular Harder

The question

Question: are (3, โˆ’2, 1) and (1, 2, 1) perpendicular?

u = [3; โˆ’2; 1], v = [1; 2; 1]

Orthogonal means perpendicular: at a right angle.

Two vectors are orthogonal exactly when their dot product is 0.

orthogonal: at a right angle (perpendicular)
u โ€ข v = 0

1 Find the dot product

Matching entries multiplied, then added: 3 ร— 1 + (โˆ’2) ร— 2 + 1 ร— 1.

u โ€ข v = 3 ร— 1 + (โˆ’2) ร— 2 + 1 ร— 1

We work out each times.

u โ€ข v = 3 โˆ’ 4 + 1

Then we add: u โ€ข v = 0.

u โ€ข v = 0

2 Compare with 0

The dot product is 0.

So yes: the vectors are orthogonal.

= orthogonal

Careful!

Only a dot product of exactly 0 means orthogonal.

Any other number, even a small one, means not.

Careful: orthogonal: the dot product is exactly 0

3 Check

Let's check with Pythagoras.

At a right angle, the length of u squared plus the length of v squared equals the length of u plus v, squared.

right angle: โ€–uโ€–2 + โ€–vโ€–2 = โ€–u + vโ€–2

The length squared is the entries squared, added.

For u: 14.

โ€–uโ€–ยฒ = 32 + (โˆ’2)2 + 12 = 9 + 4 + 1 = 14

For v: 6.

โ€–vโ€–ยฒ = 12 + 22 + 12 = 1 + 4 + 1 = 6

u plus v: (4, 0, 2).

u + v = [4; 0; 2]

Its length squared: 20.

โ€–u + vโ€–ยฒ = 42 + 02 + 22 = 16 + 0 + 4 = 20

14 plus 6 is 20, the same as 20.

Pythagoras works: a right angle.

So the answer is right!

14 + 6 = 20 = 20

Let's look back.

First: find the dot product.

Then: compare with 0.

Last: check.

Answer
Careful: orthogonal: the dot product is exactly 0

โ–ถ Watch it solved

Practice

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

Easy

  1. dot product of (1, 2, 3) and (4, -5, 6)
    Answer
    Careful: one number, not a vector
  2. dot product of (2, 0, 1) and (3, 4, 5)
    Answer
    Careful: one number, not a vector
  3. dot product of (1, -1, 2) and (2, 3, 1)
    Answer
    Careful: one number, not a vector
  4. length of (2, 3, 6)
    Answer
    โ€–vโ€– = 7
  5. length of (1, 2, 2)
    Answer
    โ€–vโ€– = 3
  6. length of (4, 4, 7)
    Answer
    โ€–vโ€– = 9
  7. are (1, 2, -1) and (3, 0, 3) orthogonal
    Answer
    Careful: orthogonal: the dot product is exactly 0

Medium

  1. are (1, 2, 3) and (1, 1, 1) orthogonal
    Answer
    Careful: orthogonal: the dot product is exactly 0
  2. are (2, -1, 1) and (1, 3, 1) orthogonal
    Answer
    Careful: orthogonal: the dot product is exactly 0
  3. are (1, 1, 1, 1) and (1, -1, 1, -1) orthogonal
    Answer
    Careful: orthogonal: the dot product is exactly 0
  4. dot product of (1, 2, -3, 4) and (2, 0, 1, -1)
    Answer
    Careful: one number, not a vector
  5. length of (2, 4, 2)
    Answer
    โ€–vโ€– = 2โˆš6
  6. length of (1, 1, 1)
    Answer
    โ€–vโ€– = โˆš3
  7. unit vector of (2, 1, 2)
    Answer
    Careful: divide EVERY entry by the length
  8. unit vector of (2, 3, 6)
    Answer
    Careful: divide EVERY entry by the length

Harder

  1. are (3, -2, 1) and (1, 2, 1) perpendicular
    Answer
    Careful: orthogonal: the dot product is exactly 0
  2. are (1, 0, 2) and (2, 5, -1) orthogonal
    Answer
    Careful: orthogonal: the dot product is exactly 0
  3. are (1, 2, 2) and (2, 1, -1) orthogonal
    Answer
    Careful: orthogonal: the dot product is exactly 0
  4. length of (1, -2, 3, 1)
    Answer
    โ€–vโ€– = โˆš15
  5. unit vector of (1, 2, 2, 4)
    Answer
    Careful: divide EVERY entry by the length
  6. unit vector of (-1, 4, 8)
    Answer
    Careful: divide EVERY entry by the length
  7. dot product of (3, 1, 2) and (-2, 4, 1)
    Answer
    Careful: one number, not a vector