Jorge Valle

Jorge Valle

Jorge Valle is a front end developer with a particular passion for, and expertise in, JavaScript and user interfaces. Lately, he's also been diving into machine learning.

Vector addition

Vectors used

Here are the 2 vectors that I will be referring to.

$$ A = \begin{bmatrix} 1, & 2, & 3 \end{bmatrix} \\ B = \begin{bmatrix} 4, & 5, & 6 \end{bmatrix} $$
Figure 1: Vectors used.

Addition

When adding vectors, we add their corresponding elements together.

$$ \begin{align} A + B & = \begin{bmatrix} 1, & 2, & 3 \end{bmatrix} + \begin{bmatrix} 4, & 5, & 6 \end{bmatrix} \\ & = \begin{bmatrix} 5, & 7, & 9 \end{bmatrix} \end{align} $$
Figure 2: Adding the corresponding elements.

To abstract out the rule, we can first express the vectors as being composed of their enumerated elements, up to the nth element.

$$ A = \begin{bmatrix} a_1, & a_2, & \cdots & a_n \end{bmatrix} \\ B = \begin{bmatrix} b_1, & b_2, & \cdots & a_n \end{bmatrix} $$
Figure 3: Abstracting out the terms.

Then, we can formalize the rule for the generic case.

$$ A + B = \begin{bmatrix} a_1 + b_1, & a_2 + b_2, & \cdots & a_n + b_n \end{bmatrix} $$
Figure 4: Formalizing the rules.

Books, patrons and coffee in Caffè San Marco, Trieste