You are on page 1of 17

ME103 LINEAR ALGEBRA

DR. ORHAN KEKLICIOGLU

References:
• Applications of Linear Algebra by Gordon C. Everstine
• Linear Algebra by David Cherney, Tom Denton, Rohit Thomas and Andrew Waldron
• Linear Algebra, A gentle introduction by Shivkumar Kalyanaraman
• Lecture Notes, Prof.Dr.Şaban EREN

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:6/No:1


PART 6
VECTORS

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:6/No:2


1.DEFINITION OF VECTORS
A vector is a list of numbers. There are (at least) two ways to interpret what this list of numbers
mean: One way to think of the vector as being a point in a space. Then this list of numbers is a
way of identifying that point in space, where each number represents the vector’s component
that dimension. Another way to think of a vector is a magnitude and a direction, e.g. a quantity
like velocity (“the fighter jet’s velocity is 250 mph north-by-northwest”). In this way of think of
it, a vector is a directed arrow pointing from the origin to the end point given by the list of
numbers. In this class we’ll denote vectors by including a small arrow overtop of the symbol
like so: 𝑎 . Another common convention you might encounter in other texts and papers is to
denote vectors by use of a boldface font a . An example of a vector is 𝑎= [4, 3]. Graphically, you
can think of this vector as an arrow in the x-y plane, pointing from the origin to the point at
x=3, y=4
In this example, the list of numbers was only two elements long, but in principle it could be any length. The dimensionality
of a vector is the length of the list. So, our example 𝑎 is 2-dimensional because it is a list of two numbers. Not surprisingly
all 2-dimentional vectors live in a plane. A 3-dimensional vector would be a list of three numbers, and they live in a 3-D
volume.

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:3


1.DEFINITION OF VECTORS
If we recall from elementary physics, a vector has a direction where its points. In addition, it also has a length.

For instance, a force can be illustrated and defined by means of vectors. The longer the arrow, the stronger is the force
that we are applying. Again, in physics, we can move our vector in space, but as long as direction and length are the same,
it is going to be the same vector.

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:4


1.DEFINITION OF VECTORS
On the other hand, in machine learning, we can define vectors as an arbitrary ordered set of numbers. For instance,
when we work with regression problems, we can define a vector that describes a second-hand car. For instance, we
want to develop a smart AI agent for finding a car in a huge database that we can call “a good buy”. In such a case, a car
can be described with its price, mileage, engine power and a year of the production. Here, the most important thing is
that every “car vector” is described with these attributes in the same order. So, in this example, we have a vector of
dimension (size) 4.

In addition, image pixels can be represented as an RGB vector (red, green, blue). For instance, we can define the following
vectors that we use for the color image processing.

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:5


2.MAGNITUDE AND DIRECTION OF VECTORS
The “magnitude” of a vector is the distance from the endpoint of the vector to the origin – in a word, it’s length. Suppose
we want to calculate the magnitude of the vector 𝑎= [4,3]. This vector extends 4 units along the x-axis, and 3 units along
the y-axis. To calculate the magnitude 𝑎 of the vector we can use the Pythagorean theorem ( 𝑥 2 + 𝑦 2 = 𝑧 2 ).

The magnitude of a vector is a scalar value – a number representing the length of the vector independent of the
direction. There are a lot of examples were the magnitudes of vectors are important to us: velocities are vectors, speeds
are their magnitudes; displacements are vectors, distances are their magnitudes.

To complement the magnitude, which represents the length independent of direction, one might wish for a way of
representing the direction of a vector independent of its length. For this purpose, we use “unit vectors,” which are quite
simply vectors with a magnitude of 1. A unit vector is denoted by a small “carrot” or “hat” above the symbol. For
example 𝑎, represents the unit vector associated with the vector . To calculate the unit vector associated with a
particular vector, we take the original vector and divide it by its magnitude. In mathematical terms, this process is
written as:

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:6


2.MAGNITUDE AND DIRECTION OF VECTORS
A unit vector is a vector of magnitude 1. Unit vectors can be used to express the direction of a vector independent of its
magnitude

Returning to the previous example of 𝑎= [4, 3]. , recall 𝑎 =5 . When dividing a vector (𝑎) by a scalar ( 𝑎 ), we divide
each component of the vector individually by the scalar. In the same way, when multiplying a vector by a scalar we will
proceed component by component. Note that this will be very different when multiplying a vector by another vector, as
discussed below. But for now, in the case of dividing a vector by a scalar we arrive at:

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:7


2.MAGNITUDE AND DIRECTION OF VECTORS
As shown in red in the figure, by dividing each component of the vector by the same number, we leave the direction of
the vector unchanged, while we change the magnitude. If we have done this correctly, then the magnitude of the unit
vector must be equal to 1 (otherwise it would not be a unit vector). We can verify this by calculating the magnitude of
the unit vector 𝑎

So we have demonstrated how to create a unit vector 𝑎 that has a magnitude of 1 but a direction identical to the
vector 𝑎 . Taking together the magnitude 𝑎 and the unit vector 𝑎 we have all of the information contained in the
vector 𝑎 , but neatly separated into its magnitude and direction components. We can use these two components to re-
create the vector 𝑎 by multiplying the vector 𝑎 by the scalar 𝑎 like so:

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:8


3.ALGEBRAIC OPERATIONS OF VECTORS
• Equality of two vectors

Example 1: We have two vectors with the same direction, but


the magnitudes (or length of the vectors) are different. Vector a
does not equal vector b in this example. This example seems
pretty simple, because the same rule applies for scalars; if the
magnitude is different, the quantities are not equal.

Example 2: This example is a little more complex. In this case,


we have two vectors with equal magnitude, but the directions
are different. Vector a does not equal vector b in this example.

Example 3: In this example, we have two vectors with equal


length and equal direction. Vector is equal to vector b. For two
vectors to be equal, they must have both the magnitude and the
directions equal.

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:9


3.ALGEBRAIC OPERATIONS OF VECTORS
• Vector addition and subtraction

To add two vectors, a and b, we first break each vector into its
components, ax and ay, and bx and by, as shown on the figure.
Now since the components of vector a and vector b are scalars,
we can add the x-components to generate the x-component of
new vector c:

cx = ax + bx

Similarly, we can add the y-components:

cy = ay + by

The new components, cx and cy, completely define the new


vector c by specifying both the magnitude and the direction.

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:10


3.ALGEBRAIC OPERATIONS OF VECTORS
• Multiplying a vector by a scalar

When a vector is multiplied by a scalar quantity, then the


magnitude of the vector changes in accordance with the
magnitude of the scalar but the direction of the vector remains
unchanged.

Suppose we have a vector 𝑎, then if this vector is multiplied by a


scalar quantity k then we get a new vector with magnitude as
|k𝑎|and the direction remains same as the vector 𝑎 if k is
positive and if k is negative then the direction of k becomes just
opposite of the direction of vector 𝑎 .

Now let us understand visually the scalar multiplication of the


vector

Let us take the values of ‘k ‘to be = 2,3,-3,−1/2 and so on.

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:11


3.ALGEBRAIC OPERATIONS OF VECTORS
• 𝒊, 𝒋, 𝒌 Unit Vectors
𝑖, 𝑗, 𝑘 vectors are unit vectors in the direction of x, y, z axes.

Using the rule of product of a vector by a scalar and the sum of vectors, the analitical def. of a vector.

𝑎 = 𝑎1 𝑖 + 𝑎2 𝑗 + 𝑎3 𝑘

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:12


3.ALGEBRAIC OPERATIONS OF VECTORS
Ex:1 Find the magnitude of given vector Ex:2 Find the magnitude of

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:13


3.ALGEBRAIC OPERATIONS OF VECTORS
Ex:3 Find the magnitude of resultant vector and unit vector of resultant vector

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:14


3.ALGEBRAIC OPERATIONS OF VECTORS
• Scalar multiplication of two vectors

The scalar multiplication of two vectors, 𝑎 and 𝑏, is equal to multiplying of the magnitude of these vectors a and b
and the cos of angle between the vectors:
𝑎. 𝑏 = 𝑎 . 𝑏 𝐶𝑜𝑠𝜃

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:15


3.ALGEBRAIC OPERATIONS OF VECTORS
• Scalar multiplication of two vectors
Ex1: Find the angle between the given vectors.

𝑎. 𝑏 = 𝑎 . 𝑏 𝐶𝑜𝑠𝜃

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:16


3.ALGEBRAIC OPERATIONS OF VECTORS
• Scalar multiplication of two vectors
Ex1: Show the given vectors are perpendicular to each other.

𝑎. 𝑏 = 𝑎 . 𝑏 𝐶𝑜𝑠𝜃

ME 103 LINEAR ALGEBRA Dr. Orhan KEKLIKCIOGLU Lecture:5/No:17

You might also like