6

Click here to load reader

Lecture 1 of CS130

Embed Size (px)

DESCRIPTION

Lecture 1 of CS130

Citation preview

Page 1: Lecture 1 of CS130

An m× n matrix A is a rectangular array of mn real numbers ar-

ranged in m rows and n columns.

A =

a11 a12 · · · a1n

a21 a22 · · · a2n... ... ...

am1 am2 · · · amn

Remark: The matrix A can simply be represented Am,n = [aij].

If m = n then A is said to be square matrix of order n, denoted

by An, with aii, i = 1, . . . , n forming the diagonal of A.

A diagonal matrix A is a square matrix [aij] with aij = 0, for

every i 6= j.

A =

2 0

0 −3

B =

0 0 0

0 −1 0

0 0 2

A scalar matrix A is a diagonal matrix [aii] with aii = c, a con-

stant.

The identity matrix In is a scalar matrix with aii = 1.

Two matrices A = [aij] and B = [bij] are said to equal, denoted

A = B, if and only if aij = bij for every i = 1, . . . ,m and for every

j = 1, . . . , n.

(Needless to say, matrices A and B should be at least of the same

size.)

A =

1 −2

0 3

B =

1 a + b

c b

Matrices A and B are equal if a = −5, b = 3, and c = 0.

1

Page 2: Lecture 1 of CS130

Matrix Operations:

1. Matrix Addition: If A = [aij] and B = [bij] are m × n

matrices, then the sum of A and B, denoted by A + B, is an

m× n matrix [cij] where cij = aij + bij.

2. Scalar Multiplication: If A = [aij] is an m × n matrix, and

r is a real number, then the scalar multiple of A by r, denoted by

rA, is an m× n matrix [cij] where cij = raij.

3. Matrix Multiplication: If A = [aij] is an m × p matrix, and

B = [aij] is a p×n matrix, then the product of A and B, denoted

by AB, is an m× n matrix [cij] where

cij = ai1b1j + ai2b2j + · · · + aipbpj.

Example:

A =

1 2 −1

0 −3 2

B =

−3 2

1 5

2 0

Remarks:

a. For AB to be defined, A and B should be compatible matrices

(or matrices of appropriate sizes).

b. If A and B are matrices of appropriate sizes, AB is defined

but BA may not be defined. BA will be defined only if m = n.

c. If m = n, then AB is m× n, while BA is p× p. Thus AB

and BA are of different sizes.

d. Even if AB and BA are of the same size, in general, the two

are not equal.

Example:

A =

1 2

3 2

B =

2 −1

−3 4

2

Page 3: Lecture 1 of CS130

4. Transpose of a Matrix: If A = [aij] is an m× n matrix, then

the transpose of A, denoted by AT = [aTij], is the n × m matrix

such that aTij = aji.

A matrix A is said to be symmetric if AT = A. That is, A is a

square matrix with aij = aji.

A matrix A is said to be skew-symmetric if AT = −A.

Example:

A =

1 2 3

2 1 4

B =

3 −1 3

4 1 5

2 1 3

C =

3 −2

2 4

D =

2 −4 5

0 1 4

3 2 1

E =

−4 5

2 3

If possible, compute the following:

1. C + E

2. AB and BA

3. 2D − 3B

4. CB + 2D

5. AT and (AT )T

6. (AB)T and BTAT

7. BTC + A

3

Page 4: Lecture 1 of CS130

Properties of Matrix Operations:

Theorem 1: For m× n matrices A, B and C, we have

1. A + B = B + A

2. (A + B) + C = A + (B + C)

3. There is an m × n zero matrix 0 ( i.e. aij = 0,∀i, j ) such

that A + 0 = 0 + A = A.

4. There is an m×n matrix D such that A+D = 0 and D+A = 0

→ D = −A.

Theorem 2: If A, B, and C are matrices of appropriate sizes,

then

1. A(BC) = (AB)C

2. A(B + C) = AB + AC

3. (A + B)C = AC + BC

Theorem 3: For real numbers r, s, and matrices A and B of

appropriate sizes, we have

1. r(sA) = rsA

2. (r + s)A = rA + sA

3. r(A + B) = rA + rB

4. A(rB) = r(AB) = (rA)B

Theorem 4: If r is a scalar, and A and B are matrices of appro-

priate sizes, then

1. (AT )T = A

2. (A + B)T = AT + BT

3. (AB)T = BTAT

4. (rA)T = rAT

4

Page 5: Lecture 1 of CS130

Lower and Upper Triangular Matrices

A square matrix An = [aij] of order n is a lower triangular matrix

if aij = 0 for i < j,∀i = 1, . . . , n,∀j = 1, . . . , n.

A square matrix An = [aij] of order n is an upper triangular matrix

if aij = 0 for i > j,∀i = 1, . . . , n,∀j = 1, . . . , n.

The pth-power of a square matrix A, denoted by Ap, is the square

matrix

Ap = A · A · · · ·A︸ ︷︷ ︸p factors

.

Remarks:

1. The pth-power of a lower triangular matrix is also a lower tri-

angular matrix.

2. The pth-power of an upper triangular matrix is also an upper

triangular matrix.

3. The pth-power of a diagonal matrix is a diagonal matrix such

that if

D =

d11 0 0 · · · 0

0 d22 0 · · · 0... ... ... ...

0 0 0 · · · dnn

then

Dp =

dp11 0 0 · · · 0

0 dp22 0 · · · 0

... ... ... ...

0 0 0 · · · dpnn

.

5

Page 6: Lecture 1 of CS130

If Ak+1 = A where k is the least positive integer, then A is

periodic of period k. In particular, if A2 = A, then A is idempotent.

If Ap = 0 where p is the least positive integer, then A is nilpotent

of index p.

Inverse of a Matrix

A square matrix A is said to be invertible if there exists a square

matrix B such that AB = I and BA = I . In this case we denote

B = A−1.

Properties: For invertible matrices A and B of the same order,

1. (A−1)−1 = A

2. (AB)−1 = B−1A−1

6