Matrix operations

We introduce various operations on matrices. A matrix can be multiplied by a scalar. Two matrices can be added or multiplied. A matrix can be transposed. Writing down these operations explicitly can be tedious, so we introduce a systematic notation for representing matrices and their elements.



We want to denote each entry of a matrix systematically.

Suppose we have a 2×3 matrix

M=(112172).

This may be written as

M=(m11m12m13m21m22m23)

where m11=1, m21=1, etc. But if we have a 100×100 matrix, this way of writing is very tedious, to say the least. In mathematics, it is crucial to be ``appropriately lazy''. So here's what we usually do:

M=(mij)

where it is understood that the indices i and j run through some appropriate ranges (in this particular example, i=1,2 and j=1,2,3.) This is a very tidy way. Furthermore, when M is a matrix, we also write (M)ij to indicate its (i,j)-element (i-th row, j-th column). Thus, if we have M=(mij), we have (M)ij=mij.

Definition (Scalar-matrix multiplication)

Let A=(aij) be an n×m matrix, and λR be a constant. Then the scalar multiplication of A by λ is defined by

λA=(λaij).

That is,

λA=(λa11λa12λa1mλa21λ22λa2mλan1λan2λanm).

Another way to write this is

(λA)ij=λaij.

Example.

3(112172)=(3363216).

Definition (Matrix addition)

Let A=(aij) and B=(bij) be both n×m matrices. We define a new n×m matrix A+B by

A+B=(aij+bij).

Another way to write this is

(A+B)ij=(A)ij+(B)ij.

Remark. To add two matrices, their sizes must be exactly equal. □

Example. (112172)+(321456)=(4333128).

Definition (Matrix multiplication)

Let A=(aij) be an n×m matrix and B=(bij) be an m×p matrix. We define a new n×p matrix AB by

AB=(k=1maikbkj)

Another way to write this is

(AB)ij=k=1m(A)ik(B)kj.

Remark

  1. To multiply two matrices, the number of columns of the first matrix and the number of rows of the second matrix must be equal.
  2. Even if AB is defined, BA may not be defined because the sizes may not match.
  3. In general, matrix multiplication is not commutative. That is, AB=BA does not hold in general.

Example. (112172)(100123)=(57313).

Example

(1234)(2314)=(4111025).

(2314)(1234)=(781114).

Thus,

(1234)(2314)(2314)(1234).

Definition (Transpose)

Let A=(aij) be an n×m matrix. The transpose of A, denoted AT is the m×n matrix whose entry in the i-th row and j-th column is aji. In other words,

(AT)ij=(A)ji.

``The (i,j)-element of AT is the (j,i)-element of A.''

Example. (112172)T=(111722).

Lemma

Let A be a matrix. Then,

(AT)T=A.

That is, the transpose of the transpose of A is A itself. 

Proof

((AT)T)ij=(AT)ji=(A)ij.


n-dimensional row vectors a=(a1,,an) and b=(b1,,bn) may be regarded as 1×n matrices. Consequently, the transpose bT, a column vector, may be regarded as an n×1 matrix. We can matrix-multiply a and bT to have a 1×1 ``matrix'', that is,

abT=(a1b1+a2b2++anbn).

If we identify 1×1 matrices with scalars, this result is nothing but the scalar product. Thus we have

abT=a,b.

This observation can be generalized as follows. Suppose the rows of the n×m matrix A are the m-dimensional row vectors a1,a2,,an, that is,

A=(aij)=(a1a2an).

Similarly, suppose the columns of the m×p matrix B are the m-dimensional column vectors b1T,b2T,,bpT, that is,

B=(bij)=(b1Tb2TbpT).

Since biT is a column vector, its transpose bi is a row vector. We have

AB=(a1a2an)(b1Tb2TbpT)=(a1,b1a1,b2a1,bpa2,b1a2,b2a2,bpan,b1an,b2an,bp)=(ai,bj).

Thus, every element of a matrix product AB is a scalar product between a row vector and a column vector.



Comments

Popular posts from this blog

Birth process

Branching processes: Mean and variance

Informal introduction to formal logic