Matrices and vectors

Content of the topic


Matrix operations

Matrices are really harmless creatures in mathematics.

An  matrix is simply a rectangular array of numbers, arranged in n rows and k columns.

We will use uppercase letters to refer to matrices. Look at this example:

This is a (2X3) matrix.

We refer to the elements of a matrix by lowercase letters with subscripts indicating two indices. Each element has a row index,

and a column index.

We refer to the elements of a matrix by lowercase letters with subscripts indicating two indices. Each element has a row index,

and a column index.

So, an  matrix that has n rows and k columns,

looks something like this:

Matrices are very useful tools, that's why they take center stage in Linear Algebra.

However, before we could see how useful they are, we need to review some basic matrix operations.

1. SCALAR MULTIPLICATION

A scalar is not a disease; it means a number, in most cases a real number.

2. ADDITION

An  matrix can only be added to another  matrix.

3. MULTIPLICATION

Well, this is the most exciting operation.

An  matrix can only be multiplied by a  matrix.

The resulting product matrix will have as many rows as A had, and as many columns as B had. The elements are created by multiplying a row from A by a column from B.

Here comes a trick, its scientific name is Falk's scheme. The point is that we arrange the matrices in a special way, with their "corners" touching, like this:

We got the product!

One important property of matrix multiplication is

that it is not commutative.

For example, if we try to do this multiplication in the opposite order,

we realize that it isn't even possible.

Let's see a few special types of matrices.


Special types of matrices

SQUARE MATRIX 

It is a square-shaped matrix with the same number of rows and columns.

Example:

DIAGONAL MATRIX

The diagonal matrix is a square matrix where all elements outside the main diagonal are zero.

Example:

Therefore, in diagonal matrices, only the main diagonal matters, as all the other elements are zero.

That's why some people only indicate the main diagonal elements. This strange symbol

indicates a diagonal matrix.

IDENTITY MATRIX

The identity matrix (or unit matrix), denoted by I, is a matrix where for any , .

The identity matrix is a diagonal matrix where all elements on the main diagonal are equal to one.

INVERSE MATRIX

The inverse matrix is denoted by , and this is a matrix that does this:

  (right inverse)         (left inverse)

Later we will see that it isn't that easy to figure out the inverse of a matrix.

This inverse thing is a lot easier with real numbers where:

the inverse of   is      because 

the inverse of   is      because 

TRANSPOSE

The transpose matrix is created by swapping the rows and the columns of the matrix. It is indicated by  or                                

ROW COLUMN  COLUMN ROW

Example:

        OR       

A square matrix whose transpose is equal to itself is called a symmetric matrix.

Here is an example of a symmetric matrix:

None of this sounds too exciting right now, but soon will come the time when we will need them.

Now, let's take on vectors!


Vector operations

Matrices with a single column are called vectors.

Vectors are indicated by underlined lower case letters.

Here are two vectors:

Vector  is a  vector, and vector  is a  vector, but it is redundant to say the  part, as we already know they have only one column - that's why we call them vectors.

So, it is plenty enough if we just say how many numbers are in the vector. These numbers are called the coordinates of the vector.

It is comforting to know that what we recognize as a vector in geometry,

and what we defined as a vector just now, correspond to each other.

If we take three lines in space so that

they are perpendicular to each other, and then

we put a scale on them, then geometric vectors

can be represented by number triplets.

So, when we talk about vectors, we could be thinking about

 matrices and also geometric forms.

Let's see what kind of operations we can do with vectors.

VECTOR OPERATIONS

1. SCALAR MULTIPLICATION 

Example:

2. ADDITION          

Example:

PROPERTIES:

Commutative:

Associative:

3. MULTIPLICATION 

Dot product (also called scalar product or inner product):                                       Dyadic product (also called tensor product or outer product):

PROPERTIES:

Commutative:

Not associative:

Example:

 and  

     and

Dot product:

Dyadic product:

PROPERTIES:

Not commutative

Not associative

Example:

 and

Dyadic product:

From these two types of products the dot product

will be much more useful for us, so at this point

we say good bye to dyadic products.

As to the dot product, let's introduce

a simple notation.

This way we can save a few *.

But let's see what else we can do with dot products.


Dot product, and the angle between two vectors

Creating dot products of vectors is not only excellent entertainment, but also useful for calculating the angle between two vectors.

We can do this because there is this other formula for dot product:

where  is the angle between the two vectors,

, in other words, the length of vector

, in other words, the length of vector

To calculate the angle between the two vectors, we write their dot product using both formulas.

Here is an example:

Dot product by the earlier formula:

Dot product by the new formula:


A few operations with matrices and vectors

Now we have a few matrices and vectors, and we need to do a few operations on them.

Well, let's do them one by one.

There is a little problem here.  doesn’t work.

Unfortunately there is no trick for exponentiation of matrices, so if we need the square of this matrix, we have to raise it to the second power by multiplying the matrix by itself.

If we needed to raise this matrix to the fourth power, that would take a long time.

But we are lucky, as we only need its square.

We only have  left. We just hit the jackpot with this one, as  is a diagonal matrix.

Diagonal matrices are easy to raise to powers, because all we have to do is take the elements of the main diagonal one by one, and raise them to the required power.

This method only works for diagonal matrices, but it does wonders there.

If we multiplied it for times in a sequence, we would get the same result,

except slower – if you want to verify this, try it yourself and see.


The equation of the line and the equation of the plane

It's time to do some geometry.

There's nothing to worry about, it's just a few little things. Let's start with vectors and lines in the plain.

The equation of a line and the equation of a plane

It's time to do some geometry.

There's nothing to worry about, it's just a few little things. Let's start with vectors and lines in the plane.

EQUATION OF A LINE: If  is a point on the line, and  

                            is the normal vector of the line:

Just a reminder: the normal vector of a line is

the non-zero vector that is perpendicular to that line.

VECTOR BETWEEN 2 POINTS: If  and are points,

                                      then the vector between these points:

DISTANCE OF 2 POINTS: If  and are points,

                            then the distance between these points:

It's all the same in space, except there are three coordinates.

EQUATION OF A PLANE: If  is on the plane and

is the normal vector of the plane:

Just a reminder: the normal vector of a line is

the non-zero vector that is perpendicular to that line.

VECTOR BETWEEN 2 POINTS: If  and  are points,

                                  then the vector between these points:

DISTANCE OF 2 POINTS: If  and  are points,

                            then the distance between these points:

Let's try to come up with the equation of a line in space. This would be useful for us, but it is not included in this list.

Unfortunately there will be some problems with it, but let's try anyway.

Let's find the equation of the line where point  is on the line, and

is the direction vector of the line.

Here, we have to use the direction vector instead of the normal vector, because in space

it is not obvious which vector is perpendicular to the line.

The direction vector, on the other hand, is specific, only its length may vary.

If  is an arbitrary point on the line, then

This  vector is a multiple of the line's direction vector

If , then we divide by it, if it is zero, then

If , then we divide by it, if it is zero, then

If , then we divide by it, if it is zero, then

All of them are equal to , therefore they must be equal to each other, too.

This is the system of equations of a line in space.

Let's see an example:

Find the equation of the line where point  is on the line, and  

is the direction vector of the line.

Here is the system of equations of the line:

Unfortunately,  will cause some trouble.

In such cases

Next, let's see a typical exercise.

Find the equation of a line in the plane, where point  is on the line, and the line is perpendicular to the line described by the equation of

Find the equation of a plane in space, where point  is on the plane and the plane is perpendicular to the line described by the following system of equations:

The normal vector of line  is   

We can make use of this vector if

we rotate it by , because then

it will be the normal vector of the line we are trying to define.

To rotate a vector in the plane by ,

we swap its coordinates,

and multiply one of them by .

We have the normal vector, so

the equation of the line is:

Let's see what we can do over here.

The normal vector of the plane happens to be the direction vector of the line.

The direction vector of the line:

The normal vector of the plane:

Here comes the equation of the plane:

And finally, another typical exercise.

Find the equation of a line in the plane, where points  and  are on the line.

Find the equation of the plane in space, where points , , and  are on the plane.

 If  is a point on the plane and

is the normal vector of the plane, the equation of the line will be:

 If  is a point on the plane and

is the normal vector of the plane, the equation of the plane will be:

We have plenty of points, but we don't have a single normal vector,

so we have to make one.

Let's rotate this by , and that gives us the normal vector.

To rotate a vector in the plane by ,

we swap its coordinates,

and multiply one of them by .

The equation of the line:

We will have a problem with the plane here.

In space there is no such thing

as rotating a vector by .

We have to figure out something else to get the plane's normal vector.

We would need a vector that is perpendicular to the triangle determined by points , , and . This vector will be the so called cross product.


The cross product, and its use

 The cross product of vectors  and  is vector ,

that is perpendicular to the plane determined by vectors  and , and where

To get the cross product, we have to calculate this determinant.

It is funny that determinants will only appear at a later stage, but in spite of that, we will try to calculate this now.

We will expand the determinant along the first row, but don't worry, everything will be simple. Well, here it is:

We will figure out these soon. It is intentional that we have a minus here, instead of a plus.

All of these would be much easier to grasp if we knew the expansion rules included in the chapter about determinants. If someone decides to check out what those rules are, we can safely assume that nobody can prevent them from doing so.

Now let's get down to business.

Let's see a specific example.

Here is a specific example:

Now let's get down to business.

Here is the cross product:

Let's see two exercises for a typical geometry application of the cross product.

One exercise is to find the equation of a line in the plane where two given points are on the line. We don't need the cross product for this.

The other one involves finding the equation of a plane in space where three given points are on the plane. We do need the cross product for this.

Find the equation of the line in the plane, where point  is on the line, and the line is perpendicular to line

Find the equation of the plane, where  is on the plane that is perpendicular to the line described by:

The normal vector of line  is   

We can make use of this vector if

we rotate it by , because then

it will be the normal vector of the line we are trying to define.

To rotate a vector in the plane by ,

we swap its coordinates, 

and multiply one of them by .

We have the normal vector, so

the equation of the line is:

Let's see what we can do over here.

The normal vector of the plane happens to be the direction vector of the line.

Here comes the equation of the plane:

And finally, another typical exercise.

Find the equation of a line in the plane, where points  and  are on the line.

Find the equation of the plane in space, where points , , and  are on the plane.

 If  is a point on the plane and

is the normal vector of the plane, the equation of the line will be:

 If  is a point on the plane and

is the normal vector of the plane, the equation of the plane will be:

We have plenty of points, but we don't have a single normal vector,

so we have to make one.

Let's rotate this by , and that gives us the normal vector.

To rotate a vector in the plane by ,

we swap its coordinates,

and multiply one of them by .

The equation of the line:

Here, at the plane, the cross product will yield the normal vector.

The equation of the plane:

And then it is done.