You are on page 1of 9

StatLect

Index > Matrix algebra

Vectors and matrices


by Marco Taboga, PhD

This lecture provides an informal introduction to matrices and vectors.

Matrix

A matrix is a two-dimensional array that has a fixed number of rows and


columns and
contains a number at the intersection of each row and column. A
matrix is usually
delimited by square brackets.

Example
The following is an example of a matrix having two rows and two
columns:

Dimension of a matrix

The number of rows and columns of a matrix constitute its dimension. If a


matrix has

rows and

columns, we say that it is a

matrix, or that it has dimension
.

Example
Define a
matrix

The
matrix

has

rows and

columns. So, we say that

is a

matrix.
Elements of a matrix

The numbers contained in a matrix are called elements of the matrix (or
entries, or
components). If

is a matrix, the element at the intersection of row

and column

is
usually denoted by

(or
)
and we say that it is the
-th
element of
.

Example
Let

be a

matrix defined as
follows:

The
element of

at the intersection of the third row and the first column, i.e.,
its
-th
element
is

Vectors

If a matrix has only one row or only one column it is called a vector.

A matrix having only one row is called a row vector.

Example
The

matrix

is
a row vector, because it has only one row.

A matrix having only one column is called a column vector.

Example
The

matrix

is
a column vector because it has only one column.

Scalars
A matrix having only one row and one column is called a scalar.

Example
The

matrix

is
a scalar. In other words, a scalar is a single number.

Equal matrices

Equality between matrices is defined in the obvious way. Two



matrices

and

having the same dimension are said to be equal if and only if all their
corresponding
elements are equal to each
other:

Zero matrices

A matrix

is a zero matrix if all its elements are equal to zero, and
we write

Example
If

is a

matrix and
,
then

Square matrices

A

matrix is called a square matrix if the number of its rows is
the same as the
number of its columns, that is,
.

Example
The

matrix

is
a square matrix.
Example
The

matrix

is
a square matrix.

Diagonal and off-diagonal elements

Let

be a square matrix. The diagonal (or main diagonal of
)
is the set of all
elements

such that
.
The elements belonging to the diagonal are called
diagonal elements, and all
other elements are called off-diagonal.

Example
Let

be the

matrix defined
by

All
off-diagonal elements of

are equal to
,
while the three diagonal elements
are equal to
,
,
and
,
respectively.

Identity matrix

A square matrix is called an identity matrix if all its


diagonal elements are equal to

and all its off-diagonal elements are equal to


.
It is usually indicated by the letter
.

Example
The

matrix

is
the

identity matrix.

Transpose of a matrix
If

is a

matrix, its transpose, denoted by
,
is the

matrix such that the
-th
element of

is equal to the
-th
element of
for
any

and

satisfying

and
.
In other words, the columns of

are equal to the rows of

(equivalently, the rows of



are equal to the columns of
).

Example
Let

be the

matrix defined by

Its
transpose

is the following

matrix:

Example
Let

be the

matrix defined by

Its
transpose

is the following

matrix:

Symmetric matrices

A square matrix is said to be symmetric if it is equal to its


transpose.

Example
Let

be the

matrix defined by

Its
transpose

is the following

matrix:
which
is equal to
.
Therefore,

is symmetric.

Solved exercises

Below you can find some exercises with explained solutions.

Exercise 1

Let

be a

matrix defined
by

Find
its transpose.

Solution

Exercise 2

Let

be a

column vector defined
by

Show
that its transpose is a row vector.

Solution

Exercise 3

Let

be a

matrix defined
by
Is
it symmetric?

Solution

How to cite

Please cite as:

Taboga, Marco (2017). "Vectors and matrices", Lectures on matrix algebra.


https://www.statlect.com/matrix-algebra/vectors-and-matrices.
The books
Most of the learning materials found on this website are now available in a traditional
textbook format.

PROBABILITY AND STATISTICS BOOK

MATRIX ALGEBRA BOOK

Featured pages Main sections


Multivariate normal distribution Mathematical tools
Student t distribution Fundamentals of probability
Binomial distribution Probability distributions
Mean square convergence Asymptotic theory
Beta distribution Fundamentals of statistics
Maximum likelihood Glossary

Explore About
Hypothesis testing About Statlect
Exponential distribution Contacts
Beta function Cookies, privacy and terms of use

Glossary entries
Binomial coefficient
Estimator
Integrable variable
Distribution function
Mean squared error
Probability mass function

Share

You might also like