and the vector has n elements, then the vector lies in the set formed by taking
the Cartesian product of R n times, denoted as R
n
. When we need to explicitly
identify the elements of a vector, we write them as a column enclosed in square
brackets:
x =
x
1
x
2
.
.
.
x
n
.
We can think of vectors as identifying points in space, with each element giving
the coordinate along a different axis.
Sometimes we need to index a set of elements of a vector. In this case, we define a
set containing the indices, and write the set as a subscript. For example, to access
x
1
, x
3
, and x
6
, we define the set S = {1, 3, 6} and write x
S
. We use the − sign
to index the complement of a set. For example x
−1
is the vector containing all
elements of x except for x
1
, and x
−S
is the vector containing all of the elements
of x except for x
1
, x
3
, and x
6
.
• Matrices: A matrix is a 2-D array of numbers, so each element is identified by two
indices instead of just one. We usually give matrices upper-case variable names
with bold typeface, such as A. If a real-valued matrix A has a height of m and
a width of n, then we say that A ∈ R
m×n
. We usually identify the elements of a
matrix with its lower-case name, and the indices are listed with separating commas.
For example, a
1,1
is the upper left entry of of A and a
m,n
is the bottom right entry.
We can identify all of the numbers with vertical coordinate i by writing a “:” for
the horizontal coordinate. For example, A
i,:
denotes the horizontal cross section
of A with vertical coordinate i. This is known as the i-th row of A. Likewise,
A
:,i
is the i-th column of A. When we need to explicitly identify the elements of
a matrix, we write them as an array enclosed in square brackets:
a
1,1
a
1,2
a
2,1
a
2,2
.
Sometimes we may need to index matrix-valued expressions that are not just a
single letter. In this case, we use subscripts after the expression, but do not
convert anything to lower case. For example, f(A)
i,j
gives element (i, j) of the
matrix computed by applying the function f to A.
• Tensors: In some cases we will need an array with more than two axes. In the
general case, an array of numbers arranged on a regular grid with a variable number
of axes is known as a tensor.
One important operation on matrices is the transpose. The transpose of a matrix is
the mirror image of the matrix across a diagonal line running down and to the right,
21