Operations with vectors

Kapitoly: Vectors, Operations with vectors, Scalar product, Vector product

With vectors we can perform basic operations like addition or multiplication.

Adding vectors

If we want to add two vectors, we display them in the origin of the coordinate system and then add them to the rhombus, and the diagonal starting at the origin will be the resulting vector. Of course, an illustrative picture is prepared:

Sum of two vectors u+v

Analytically, the sum of the vectors is then the sum of the corresponding coordinates. So if you have two vectors $\vec{\mathbf{u}}=(u_1, u_2)$ and $\vec{\mathbf{v}}=(v_1, v_2)$, then the sum of $\vec{\mathbf{u}}+\vec{\mathbf{v}}$ is equal to

$$\vec{\mathbf{u}}+\vec{\mathbf{v}}=(u_1+v_1, u_2+v_2)$$

For the vectors in the figure: $\vec{\mathbf{u}}=(2, 4)$ and $\vec{\mathbf{v}}=(4, 1)$. The sum then looks like this: $\vec{\mathbf{u}}+\vec{\mathbf{v}}=(2+4, 4+1)=(6, 5)$. These coordinates correspond to the point D.

If you subtract vectors, it is the same as if you were adding the opposite vector. Analytically:

$$\vec{\mathbf{u}}-\vec{\mathbf{v}}=(u_1-v_1, u_2-v_2)$$

If you add vectors that lie on the same line and in the same direction, then you just stretch the resulting vector. If they are in opposite directions, then we subtract their magnitude. This will be easier to see from the figure:

The sum of vectors lying on the same line

Vector addition is commutative and associative. There is a vector $\vec{\mathbf{0}}$, which we call the zero vector, for which $\vec{\mathbf{u}}+\vec{\mathbf{0}}=\vec{\mathbf{u}}$, similar to numbers, holds. For every vector $\vec{\mathbf{u}}$, there is an opposite vector $-\vec{\mathbf{u}}$, for which $\vec{\mathbf{u}}+(-\vec{\mathbf{u}})=\vec{\mathbf{0}}$ holds.

Multiplying a vector by a number

If you multiply a vector by the real number k, then you just multiply both of its coordinates by k. In the geometric interpretation, this will result in "stretching" or "shrinking" the vector, or inverting it if k is negative.

Different multiples of the vector u

The figure shows that when we multiply the vector u by k, we:

  • If the absolute value of k is less than one, then the vector is smaller.
  • If the absolute value of k is greater than one, then the vector is larger.
  • If k is negative, then the vector has the opposite direction.

Linear combination of vectors

In linear algebra, we often use linear combinations of vectors. If we have vectors $\vec{\mathbf{u}}_1, \vec{\mathbf{u}}_2, \vec{\mathbf{u}}_3, \ldots$, then the linear combination of these vectors is

  • k a multiple of one of the vectors $\vec{\mathbf{u}}_n$,
  • the sum of any two or more vectors,
  • combination of the previous - we can add kn multiples of any $\vec{\mathbf{u}}_n$ vectors.

If we have vectors $\vec{\mathbf{u}}_1, \vec{\mathbf{u}}_2, \ldots, \vec{\mathbf{u}}_n$, then a vector $\vec{\mathbf{v}}$ is a linear combination of vectors $\vec{\mathbf{u}}_n$, if:

$$\vec{\mathbf{v}}=c_1\cdot \vec{\mathbf{u}}_1+c_2\cdot \vec{\mathbf{u}}_2+\ldots+c_n\cdot \vec{\mathbf{u}}_n;\quad c_i\in\mathbb{R}$$

Note that the coefficients of ci are real numbers, so we can choose zero for them, which will make one of the vectors drop out completely. Example: we have the vectors $\vec{\mathbf{u}}_1=(1,3), \vec{\mathbf{u}}_2=(0,4), \vec{\mathbf{u}}_3=(7,2)$. These are some possible linear combinations:

$$\begin{eqnarray} (8, 9)&=&1\cdot(1, 3)+1\cdot(0, 4)+1\cdot(7, 2)\\ (22, 17)&=&1\cdot(1, 3)+2(0, 4)+3(7, 2)\\ (68, 38)&=&-2(1, 3)+6(0, 4)+10(7, 2)\\ (-\frac12, -\frac{43}{2})&=&-\frac12(1, 3)-5(0, 4)+0(7, 2)\\ \end{eqnarray}$$