
Vector Multiplication
Before diving into the world of vector multiplication, it's essential to pin down the specific method of multiplication being used. This is because vector multiplication is not a one-size-fits-all operation; instead, it comes in three distinct flavors: the dot product, the cross product, and the Hadamard product, each with its own rules and applications.
- Dot Product (Scalar Product)
The dot product between two vectors is a scalar quantity. It's the sum of the products of the corresponding components of the two vectors.Take, for example, two vectors in a three-dimensional space $$ \vec{a} = \begin{pmatrix} a_1 \\ a_2 \\ a_3 \end{pmatrix} $$ $$ \vec{b} = \begin{pmatrix} b_1 \\ b_2 \\ b_3 \end{pmatrix} $$ Their dot product would be calculated as follows $$ a \cdot b = a_1 \cdot b_1 + a_2 \cdot b_2 + a_3 \cdot b_3 $$
- Cross Product
Unlike the dot product, the cross product of two vectors yields another vector, which is orthogonal (perpendicular) to the original pair. The length of this resultant vector correlates with the sine of the angle between the two vectors, peaking when the vectors are perpendicular.Let's examine two vectors in three-dimensional space $$ \vec{a} = \begin{pmatrix} a_1 \\ a_2 \\ a_3 \end{pmatrix} $$ $$ \vec{b} = \begin{pmatrix} b_1 \\ b_2 \\ b_3 \end{pmatrix} $$ The cross product in this case would be $$ a \ \text{x} \ b = \begin{pmatrix} a_2 \cdot b_3 - a_3 \cdot b_2 \\ a_3 \cdot b_1 - a_1 \cdot b_3 \\ a_1 \cdot b_2 - a_2 \cdot b_1 \end{pmatrix} $$
Bear in mind, however, that while the dot product can apply to any number of dimensions, the cross product as defined here only works in three dimensions. For other dimensions, more complex adaptations of the cross product are available.
- The Hadamard Product (component-wise multiplication)
The Hadamard product, or component-wise multiplication, represents another type of vector multiplication. Here, the product of the corresponding components of the two vectors is computed, yielding another vector.For two vectors $$ \vec{a} = \begin{pmatrix} a_1 \\ a_2 \\ a_3 \end{pmatrix} $$ $$ \vec{b} = \begin{pmatrix} b_1 \\ b_2 \\ b_3 \end{pmatrix} $$ The Hadamard product can be found using $$ \vec{a} \vec{b} = \begin{pmatrix} a_1 \\ a_2 \\ a_3 \end{pmatrix} \begin{pmatrix} b_1 \\ b_2 \\ b_3 \end{pmatrix} = \begin{pmatrix} a_1 \cdot b_1 \\ a_2 \cdot b_2 \\ a_3 \cdot b_3 \end{pmatrix} $$
While not as widely used in general mathematical discourse as the dot or cross product, the Hadamard product has found its niche within fields like machine learning. As a rule of thumb, you'll want to employ this method only when component-wise multiplication is explicitly required.
- Outer Product
A different kind of vector multiplication is the outer product. This operation takes two vectors and yields a matrix consisting of all possible products of the components of the two vectors. In an outer product, the vectors don't necessarily need to be the same size, which is why it's also referred to as a tensor product.For instance, given two vectors $$ \vec{a} = \begin{pmatrix} a_1 \\ a_2 \\ a_3 \end{pmatrix} $$ $$ \vec{b} = \begin{pmatrix} b_1 \\ b_2 \\ b_3 \end{pmatrix} $$ their outer product is the matrix $$ \vec{a} \otimes \vec{b} = \begin{pmatrix} a_1 \\ a_2 \\ a_3 \end{pmatrix} \otimes \begin{pmatrix} b_1 \\ b_2 \\ b_3 \end{pmatrix} = \begin{pmatrix} a_1 \cdot b_1 & a_1 \cdot b_2 & a_1 \cdot b_3 \\ a_2 \cdot b_1 & a_2 \cdot b_2 & a_2 \cdot b_3 \\ a_3 \cdot b_1 & a_3 \cdot b_2 & a_3 \cdot b_3 \end{pmatrix} $$