Monday, July 26, 2021

Vectors V:

Introduction:

The concept of vectors plays an important role in physics, computer graphics, probability theory, machine learning, and other fields of science and mathematics.
In this article I will introduce you to the basics of vector calculus, starting from defining vectors then seeing some of the basic operation that can be done to manipulate vectors, in the end you will find a bunch of refrences for further readings on vector calculus

What are Vectors?:

Vectors are mathematical objects that can be represented with numbers as entries, the number of entries required to represent a vector, depends on the dimension of a given vector, for instance the position vector of a ball moving in a 2 dimensional space can be represented by 2 numbers called the x-component, and y-component, each represent how far is the ball's projection on a given direction. The minimum dimensions required to model a problem (aka degrees of freedom) depends on the complexity of the problem, for example in the field of machine learning, data scientists use vectors with millions or even billions of enteries to train their models in order to solve a regression problem for example, in the other hand quantum theorists deal with vectors that have infinite number of components called state vectors which represent the most abstract form of vectors
Vectors can also be viewed as arrows defined by their magnitude and direction, the magnitude is simply the length of the vector, and the direction is is which direction the vector is pointing to, this formulation is quite useful in physics, it gives a visual intuition about the behavior of different vectors, yet this geometrical representation fails to represent vectors that exceed 3 components, because the human mind can only visualize up to only 3 dimensions beyond that it's abstraction
A vector can be represented in different equivalent forms, the following are two basic forms:

Algebraic form of a 2-D vector:

\[\vec{V} = \vec{v_x}+\vec{v_y} \equiv v_x \vec{e_x}+v_y\vec{e_y}\]
  • \(\vec{v_x}\) the vector's component along the x axis
  • \(\vec{v_y}\) the vector's component along the y axis
  • \(v_y\) the vector's projection magnitude along the x axis
  • \(v_y\) the vector's projection magnitude along the y axis
  • \(\vec{e_x}\) the unit vector along the x axis, it has a magnitude of 1 and directs toward the direction of x direction
  • \(\vec{e_y}\) the unit along the y axis, it has a magnitude of 1 and directs toward the direction of x direction
The right hand side notation is called unit vector notation
Matrix form:
\[ \vec{V} = \begin{pmatrix} v_x\\ v_y \end{pmatrix} \ \text{ or } \vec{V} = \begin{pmatrix} v_x& v_y\\ \end{pmatrix} \] Where the first is called column vector, and the second is the row vector.

Operations on Vectors:

Vectors wouldn't be so useful if we couldn't perform operations on them, here we will see five basic operations that we can use on vectors: addition, subtraction, scaling, dot product, length, and cross product (for curious readers href for refrences)

Addition and Subtraction:

As numbers, vectors too can be added, if we add two vectors \(\vec{V}\) and \(\vec{V}\)the resulting vector \(\vec{W}\) will have components, will correspond the sum of the sum of two vecotrs components respectively. \[\vec{V}=\vec{v_x}+\vec{v_y},\ \ \ \vec{U}=\vec{u_x}+\vec{u_y}\] \[\vec{W}=\vec{V} +\vec{U}, \ \ \ \vec{W} = (v_x+u_x)\vec{e_x} +(v_y+u_y)\vec{e_y}\, \ \ \ \vec{w_x} = \vec{v_x}+\vec{u_x}, \ \ \ \vec{w_y} = \vec{v_y}+\vec{u_y}\ \]
In the same spirit, vectors can be subtracted as follow: \[\vec{W} =\vec{V} -\vec{U} = (v_x-u_x)\vec{e_x} +(v_y-u_y)\vec{e_y}\] note here that the negative of a vector is another vector with the same magnitude, pointing to the opossite direction
Here is an example where the addition of two vectors can come handy, imagine with me two identical balls(billiard balls for instance) with different velocities elastically colliding (elastically means that the mass doesn't change after the collision) what would the velocity of each ball after the collision, the law of conservation of linear momentum(a vector quantity \(\vec{p}=m\vec{v}, \vec{v}\) is the velocity, m is the mass) states that the sum of intial linear momentums equal the sum of final linear momentums \(\vec{p_1}+\vec{p_2}=\vec{p_1}'+\vec{p_2}'\), \(\vec{p_1}, \vec{p_1}\) are the linear momentum of the two balls before the collision, and \(\vec{p_1}', \vec{p_1}'\) are the linear momentum of the two balls after the collision.

Scaling:

By scaling either we enlarge or reduce a vector, and we do that by multiplying it by a scalar, a scalar means a number that have a magnitude but no direction, for example if we want to make a vector \(\vec{V}\) larger by a factor \(\alpha > 1\) the resulting vector \(\vec{W}\) will be : \(\vec{W} = \alpha \vec{V} = \alpha v_x\vec{e_x} + \alpha v_y \vec{e_y}\) which is larger \(\alpha\) times in both directions, similarly if we want to make a vector smaller by a factor \(\beta\) we do the same thing, such that \(0< \beta<1 \).

Dot Product:

The dot product can be viewed as the operation that gives us the value of the magnitude of the vector \(\vec{W}\) that is the projection of the vector \(\vec{V}\) on the vector \(\vec{U}\) and it is given by: \[ W= \vec{V}.\vec{U} = \vec{v_x}\vec{u_x}+\vec{v_y}\vec{u_y}=v_x u_x + v_y u_y\] Or \[\vec{V}.\vec{U} = V U \cos(\theta)\] Where W, V and U the magintudes of the three vectors respectively, and \(\theta\) is the angle between the two vectors under dot product
The elementary work done by a force is defined the be dot prodcut of the force vector and the infinitesimal change in position vector: \[dW(F) = \vec{F}.d\vec{r}\] Another example of where dot product is used comes from machine learning's neural networks where the net input z is defined by: \[z = \vec{w}.\vec{x}\] Where \(\vec{w} \) is the weight vector, and \(\vec{x}\) is the input vector.

Length:

The legnth of a vector \(\vec{V}\) represents its magnitude or equivalently how far the head of the arrow is from the origin of the coordinates system, and it is given by: \[ V = \sqrt{v_x^2+v_y^2}\] we can prove this result by taking in account that the angle a between a vector and it self is 0 \[\vec{V}.\vec{V} = V V cos(0) = V^2, cos(0) = 1\] We the other definition of dot product we have: \[\vec{V}.\vec{V} = \vec{v_x}.\vec{v_x}+\vec{v_y}.\vec{v_y}=\vec{v_x}^2+\vec{v_y}^2\] Combining the two results we get the previous result: \[ V = \sqrt{v_x^2+v_y^2}\]

Cross Product:

The corss product of two vectors \(\vec{V}\) \(\vec{U}\) gives a resulting vector \(\vec{W}\) perpendicular(90 degrees angle) to the two vectors and it is given by: \[\vec{W} = \vec{V}\times\vec{U} = V U \sin(\theta)\vec{e}\] Notice that in the dot product the result was scalar whilist in corss product the result is vector and that why we multiplied the result by the unit vector \(\vec{e}\) which is perpendicular to both the vectors \(\vec{V}\), \(\vec{U}\), there is another formula to calculate the cross product which I didn't treat here. A nice illustration of the cross product

Conclusion:

In this article we have defined vectors and showed some of basic operations that we can preform on them.
For further readings:

The Fundamental Principles Of Quantum Mechanics

The power of physics theories lays in the fact that they give an adequate description of physical phenomena, and also can make precise pre...