Learn

Now that we know what a vector is and how to represent one, we can begin to perform various operations on vectors and between different vectors. As we’ve previously discussed, the basis of linear algebra is the linear combinations we can generate between vectors (and matrices).

Scalar Multiplication

Any vector can be multiplied by a scalar, which results in every element of that vector being multiplied by that scalar individually.

k[xyz]=[kxkykz]k \begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} kx \\ ky \\ kz \end{bmatrix}

Multiplying vectors by scalars is an associative operation, meaning that rearranging the parentheses in the expression does not change the result. For example, we can say 2(a3) = (2a)3.

Vector Addition and Subtraction

Vectors can be added and subtracted from each other when they are of the same dimension (same number of components). Doing so adds or subtracts corresponding elements, resulting in a new vector of the same dimension as the two being summed or subtracted. Below is an example of three-dimensional vectors being added and subtracted together.

[x1y1z1]+2[x2y2z2]3[x3y3z3]=[x1+2x23x3y1+2y23y3z1+2z23z3]\begin{bmatrix} x_{1} \\ y_{1} \\ z_{1} \end{bmatrix} + 2 \begin{bmatrix} x_{2} \\ y_{2} \\ z_{2} \end{bmatrix} - 3 \begin{bmatrix} x_{3} \\ y_{3} \\ z_{3} \end{bmatrix} = \begin{bmatrix} x_{1} + 2x_{2} - 3x_{3} \\ y_{1} + 2y_{2} - 3y_{3}\\ z_{1} + 2z_{2} - 3z_{3} \end{bmatrix}

Vector addition is commutative, meaning the order of the terms does not matter. For example, we can say (a+b = b+a). Vector addition is also associative, meaning that (a + (b+c) = (a+b) + c).

Instructions

The applet to the right is very similar to the one from the previous exercise. However, this one allows you to play around with two vectors (red and blue) and view their resulting summation. To drag either vector a (red) or vector b (blue) around, click on the arrowhead and move it with your mouse. Vector a + b (purple) will move based on the resulting summation (but you cannot move it directly with your mouse).

Below are some practice problems. For the vector summation ones, you can use the applet to help.

Practice Problems

Answer the following scalar multiplication problem. Click the solution below to verify your answer.

3[271]3 \begin{bmatrix} 2 \\ -7 \\ 1 \end{bmatrix}
Solution
The final answer is v = [6, -21, 3]

Answer the following vector addition problem. Click the solution below to verify your answer. Feel free to use the applet to verify it as well!

[107]+[147]\begin{bmatrix} 10 \\ -7 \\ \end{bmatrix} + \begin{bmatrix} -14 \\ 7 \\ \end{bmatrix}
Solution
The final answer is v = [-4, 0]

Finally, let’s do a more challenging one!

[1432]+7[135]5[641]\begin{bmatrix} 14 \\ -3 \\ 2 \end{bmatrix} + 7 \begin{bmatrix} -1 \\ 3 \\ -5 \end{bmatrix} - 5 \begin{bmatrix} 6 \\ -4 \\ -1 \end{bmatrix}
Solution
The final answer is v = [-23, 38, -28]

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?