alg_notes_5_15

17
UNIVERSITY OF NEW SOUTH WALES SCHOOL OF MATHEMATICS MATH 1131 MATHEMATICS 1A ALGEBRA. Section 5: - Matrices. In our last topic we used matrices to solve systems of linear equations. A matrix was simply a block of numbers, which, in that context, represented the co-efficients of the unknowns in some system of equations. In this topic, we are going to look at the basic properties of matrices, regarded simply as blocks of numbers. Definition: An m × n matrix A is simply a block of numbers written with m rows and n columns. If m = n we say that A is a square matrix. The set of all m × n matrices is denoted by M mn . In most of our work, the numbers in question will be real, but later we will also deal with matrices whose entries are complex numbers. A = a 11 a 12 ··· a 1n a 21 a 22 ··· a 2n a 31 a 32 ··· a 3n . . . . . . . . . . . . a m1 a m2 ··· a mn . We will use the notation a ij , to denote the general element in the matrix A, (similarly b ij for the general element in the matrix B and so on). We will also use the notation (A) ij to denote the general element a ij in the matrix A. For example A = 1 2 3 4 9 -2 1 2 0 5 4 3 2 is a 3 × 4 matrix and a 23 = 1 2 . In M mn there is a special matrix called the zero matrix which has all its entries equal to 0. It is generally denoted by 0. For example 0 = 0 0 0 0 0 0 0 0 0 0 0 0 is the zero matrix in M 34 . In M nn , the set of all square matrices of size n, there is another special matrix called the identity matrix. It consists of 1’s down the main diagonal, i.e. a ii = 1 and zeros everywhere else. It is generally written as I n and sometimes simply as I , where the context tells us the size. 1

Upload: danielofhouselam

Post on 06-Nov-2015

215 views

Category:

Documents


3 download

DESCRIPTION

Maths

TRANSCRIPT

  • UNIVERSITY OF NEW SOUTH WALESSCHOOL OF MATHEMATICS

    MATH 1131MATHEMATICS 1A ALGEBRA.

    Section 5: - Matrices.

    In our last topic we used matrices to solve systems of linear equations. A matrix was simplya block of numbers, which, in that context, represented the co-ecients of the unknownsin some system of equations. In this topic, we are going to look at the basic properties ofmatrices, regarded simply as blocks of numbers.

    Denition: An m n matrix A is simply a block of numbers written with m rows andn columns. If m = n we say that A is a square matrix. The set of all m n matrices isdenoted by Mmn. In most of our work, the numbers in question will be real, but later wewill also deal with matrices whose entries are complex numbers.

    A =

    0BBBBBBB@

    a11 a12 a1na21 a22 a2na31 a32 a3n...

    ......

    ...am1 am2 amn

    1CCCCCCCA :

    We will use the notation aij, to denote the general element in the matrix A, (similarly bijfor the general element in the matrix B and so on).We will also use the notation (A)ij to denote the general element aij in the matrix A.

    For example

    A =

    0B@ 1 2 3 49 2 12 05 4 3 2

    1CAis a 3 4 matrix and a23 = 12 .

    In Mmn there is a special matrix called the zero matrix which has all its entries equalto 0. It is generally denoted by 0.

    For example

    0 =

    0B@ 0 0 0 00 0 0 00 0 0 0

    1CAis the zero matrix in M34.

    In Mnn, the set of all square matrices of size n, there is another special matrix called theidentity matrix. It consists of 1's down the main diagonal, i.e. aii = 1 and zeros everywhereelse. It is generally written as In and sometimes simply as I, where the context tells us thesize.

    1

  • For example

    I2 =

    1 00 1

    !is the identity matrix in M22 and

    I3 =

    0B@ 1 0 00 1 00 0 1

    1CAis the identity matrix in M33.

    Denition: We say that two matrices A and B are equal if they have the same size (i.e. thesame number of rows and columns) and aij = bij for each i; j. In other words, their entriesin identical positions are the same.

    Addition and Subtraction of Matrices:

    We can only add or subtract matrices which have the same size, and we do this by sim-ply adding or subtracting the entries in the same position.

    More formally, if A = (aij) and B = (bij) are matrices of the same size, then we deneC = A+B, by C = (cij) where cij = aij + bij. Similarly with subtraction.

    Ex: Find A+B, and AB if A =0B@ 1 2 39 2 51 3 5

    1CA and B =0B@ 5 3 92 4 6

    8 4 2

    1CA.

    Ex: If A =

    0B@ 4 1 24 7 31 2 8

    1CA and B =0B@ 1 29 21 3

    1CA then

    2

  • Note that matrix addition is commutative and associative, soA+B = B + A and (A+B) + C = A+ (B + C) whenever the addition is dened.

    As with vectors, (a vector is really just an n 1 matrix anyway), we can multiply a matrixby a scalar in the obvious way. If A is a matrix and a scalar, then B = A is a matrixwith entries bij = aij.

    For example, if A =

    0B@ 1 2 39 2 51 3 5

    1CA then 3A =

    Note that for all matrices A, we have

    A+ 0 = 0+ A = A and 0A = 0:

    Matrix Multiplication:

    Before giving you the `formal denition' of matrix multiplication, let us see if we can guesswhat a sensible denition might be, by looking at the following simple example.

    Suppose we have 3 houses H1, H2 and H3 which order a certain number of bottles of milk,cream and a certain number of newspapers. The milk costs $ 2 , the cream $ 3 and thenewspaper $ 1. This information can be represented using matrices as follows:0BBB@

    M C NH1 1 2 3H2 2 2 1H3 5 4 3

    1CCCA0BBB@

    $231

    1CCCATo work out the total cost to each house, we would do the following. The cost to the rsthouse will be 1 2+ 2 3+ 3 1 = 11 and so on for the other houses, for the second houseit is 2 2 + 2 3 + 1 1 = 11 and for the third 5 2 + 4 3 + 3 1 = 25

    This example suggests how we might dene multiplication of an m n matrix by an n 1matrix (i.e. a vector with n entries).

    3

  • Ex: Multiply A =

    0B@ 1 2 39 2 51 3 5

    1CA by v =0B@ 123

    1CA.

    The formal denition is:

    Denition: If A = (aij) is an m n matrix and x is an n 1 matrix with entries xithen we dene the product of A and x to be the matrix b, an m 1 matrix whose entriesare given by

    bi = ai1x1 + ai2x2 + + ainxn =nX

    k=1

    aikxk for 1 i m:

    Now to multiply two general matrices together, we can think of each column of the secondmatrix as a vector and simply apply the above ideas. Notice that for this to make sense weneed the number of columns of the rst matrix to equal to number of rows of the second.In other words we can multiply an nm matrix by an m p matrix and answer will be ann p matrix.

    Ex. Multiply the matrices A and B where A =

    0B@ 1 2 39 2 51 3 5

    1CA and B =0B@ 2 35 92 4

    1CA.

    4

  • Ex: Let A =

    0B@ 2 32 53 5

    1CA and B = 1 29 2

    !.

    AB is dened but BA is not.

    The formal denition of this procedure is:

    Denition: Suppose A = (aij) is an m n matrix and B = (bij) is an n p matrix,then we dene the product C = AB to be the m p matrix whose entries, cij are given by

    cij = ai1b1j + ai2b2j + + ainbnj =nX

    k=1

    aikbkj

    for 1 i m and 1 j p.

    Ex: Find AB and BA if A =

    2 32 5

    !and B =

    9 21 3

    !.

    As you see from the above example, in general AB does not equal BA. This is extremelyimportant fact to keep in mind. In general, matrix multiplication is NOT commutative.

    Note that we write An for A A A| {z }n times

    :

    5

  • Ex: Prove by induction that for any positive integer n, 10

    !n=

    n nn1

    0 n

    !:

    Ex: Find AI and IA if A =

    2 32 5

    !and I =

    1 00 1

    !.

    From the above example, you surmise that:

    Theorem: If A is any nn matrix, and I the identity matrix of size n, then AI = IA = A.Also In = I for any positive integer n.

    Hence the identity matrix I behaves in the set of matrices just as the number 1 does inordinary arithmetic.

    Here is a list of some of the basic properties of matrix multiplication. Take careful noteof exactly what you are allowed to do with matrices.

    Theorem: If A;B and C are matrices for which the necessary sums and products aredened and is a scalar, then

    (i) A(B) = AB

    (ii) (AB)C = A(BC). (This is known as the associative law).

    (iii) (A + B)C = AC + BC and C(A + B) = CA + CB. Note that these are NOT

    6

  • in general equal to each other. (This is known as the distributive law).

    Proof: We will here only prove (ii) and the rst part of (iii), since (i) is fairly trivial.

    Suppose A is an m n matrix, B an n p matrix and C a matrix with p rows.

    To prove the result we have to show that the entries in A(BC) equal those in the matrix(AB)C. Thus,

    (A(BC))ij =nX

    r=1

    air(BC)rj =nX

    r=1

    air

    pXs=1

    brscsj

    !

    =nX

    r=1

    pXs=1

    airbrscsj =pX

    s=1

    nXr=1

    airbrscsj:

    At this stage, we have swapped the order of summation. You should check this step carefully.Continuing,

    (A(BC)ij =pX

    s=1

    nX

    r=1

    airbrs

    !csj =

    pXs=1

    (AB)iscsj = ((AB)C)ij

    For (iii), we again need to check that the entries of (A + B)C are equal to the entries inAC +BC. Thus

    ((A+B)C)ij =nX

    k=1

    (A+B)ikckj

    =nX

    k=1

    (aik + bik)ckj

    =nX

    k=1

    aikckj +nX

    k=1

    bikckj

    = (AC)ij + (BC)ij = (AC +BC)ij

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

    The Transpose:

    One other operation on matrices is the transpose. To take the transpose of a matrix, we inter-

    change the rows and columns. For example if B =

    0B@ 1 29 21 3

    1CA then BT = 1 9 12 2 3

    !.

    More formally, (AT )ij = aji:

    Thus (AT )T = A. (An operation which when composed with itself gives the identity functionis called an involution. Complex conjugation is another example of an involution.)

    Note that the transpose of a column vector is a row vector. If we take two (column) vectors,a;b, (of the same size) then the quantity aTb is a 1 1 matrix whose entry is simply thedot product or scalar product of a and b, as we saw in an earlier chapter. Note however

    7

  • for two vectors of the same size, n, then abT is an n n matrix matrix.

    Ex: Find aTb and abT for a =

    0B@ 101

    1CA and b =0B@ 231

    1CA.

    The transpose has the following properties which should be carefully noted.

    Theorem: If A and B are matrices such that A+B and AB is dened, then

    (i) (AT )T = A

    (ii) (A+B)T = AT +BT

    (iii) (A)T = AT :

    (iv) (AB)T = BTAT :

    Take particular note of result (iv). Proofs of (i), (ii) and (iii) are trivial.

    Proof: (iv) Suppose A is an m n matrix, then B is an n p matrix. Hence

    (AB)Tij = (AB)ji =nX

    k=1

    ajkbki:

    Also

    (BTAT )ij =nX

    k=1

    (BT )ik(AT )kj =

    nXk=1

    bkiajk =nX

    k=1

    ajkbki = (AB)Tij:

    Ex: Simplify AT (CBA)TC.

    8

  • Denition: A real matrix A is said to be symmetric if AT = A.

    Note that symmetric matrix must necessarily be square. Symmetric matrices have re-markable properties which are studied in second year (MATH2501).

    Ex: Write down an example of a 3 3 symmetric matrix.

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

    You can immediately see that the entries on the main diagonal of a skew-symmetric ma-trix are zero.

    Rotation Matrices:

    Suppose

    xy

    !is the position vector of a point P in 2-dim space, which has distance r

    from the origin and makes an angle of with the positive x axis.

    This vector can be written as

    r cosr sin

    !.

    Now rotate P anti-clockwise about the origin through an angle to the new point P 0 = x0

    y0

    !:

    9

  • Then x0

    y0

    !=

    r cos(+ )r sin(+ )

    !=

    r cos cos r sin sin r sin cos + r cos sin

    !

    =

    x cos y sin x sin + y cos

    !=

    cos sin sin cos

    ! xy

    != Ax:

    Note that if we apply the rotation twice, we have

    A2 =

    cos 2 sin 2sin 2 cos 2

    !

    and so on.

    The Inverse of a Matrix:

    Given a square matrix A, can we nd a matrix B such that AB = I, the identity ma-trix? In general the answer is NO, and later we shall nd a way of telling exactly when sucha matrix exists. For the moment suppose we can nd such a B. We call B the inverse of Aand write B = A1. We should read A1 as `A inverse'. A matrix A which has an inverse iscalled invertible.

    For a 2 2 matrix there is a very useful formula (which is worth learning) for the inverse. a bc d

    !1=

    1

    ad bc

    d bc a

    !:

    This formula will only work if ad bc 6= 0. This quantity is called the determinant of thematrix. You can check the formula works by simply multiplying.

    Ex: Find the inverse of

    3 12 5

    !:

    For matrices of higher order, there is no simple formula for the inverse. We will develop analgorithm for nding the inverse if it exists.

    Suppose we have a 33 invertible matrix A whose inverse X we seek to nd. We know that

    10

  • AX =

    0B@ 1 0 00 1 00 0 1

    1CA.Suppose we write X as

    x1 x2 x3

    where x1 etc are the columns of X. Thus we have

    Ax1 x2 x3

    =

    0B@ 1 0 00 1 00 0 1

    1CA. We can think of this equation as three sets of equations,namely Ax1 =

    0B@ 100

    1CA , Ax2 =0B@ 01

    0

    1CA and Ax3 =0B@ 00

    1

    1CA.To solve each of these equations, we would take A and augment it with each of the threeright hand sides in turn and row reduce. If we completely row reduce to reduced echelonform, then the solutions would appear on the right hand side of each reduction. To save timewe could do all three reductions in one go, by augmenting the matrix A with the identitymatrix and completely row reducing. This is the algorithm for nding the inverse of A.

    Ex: Find the inverse of A =

    0B@ 1 2 32 5 31 0 8

    1CA.

    Ex: Does the matrix A =

    0B@ 1 6 42 4 11 2 5

    1CA have an inverse?

    11

  • Properties of Inverses:

    Suppose that A;B are invertible matrices of the same size then

    (i) (A1)1 = A.

    (ii) (AB)1 = B1A1

    Note the second result. It is very similar to the rule we had for transposes. Observe alsothat it generalises: (ABC)1 = C1B1A1 assuming that all the matrices have the samesize and invertible.

    To see why (ii) is true, we simply note that (AB)(B1A1) = A(BB1)A1 = AIA1 =AA1 = I: Hence the inverse of AB is B1A1.

    Ex: Simplify HG(FHG)1FG.

    We can use inverses to solve equations. For example, solve 2 41 7

    !x =

    23

    !:

    Hence, if we are solving Ax = b and A is invertible, we can write x = A1b.

    We can then state the following result.

    Theorem: If A is a square matrix then Ax = b has a unique solution if and only if A

    12

  • is invertible.

    Determinants:

    We have seen that the inverse of the general 2 2 matrix a bc d

    !exists if and only if

    ad bc 6= 0.

    This quantity is called the determinant of the matrix.

    For the matrix A =

    a bc d

    !, we write its determinant as

    det(A) = ad bc or a bc d

    = ad bc:There is a similar, but more complicated formula for the determinant of a 3 3 and highersize matrices. There are various ways to dene the determinant, but we take a purely compu-tational approach and develop a method of calculating the determinant for a general matrix.

    Denition: Suppose A is a square matrix. We dene jAijj, called the ijth minor ofA, to be the determinant of the matrix obtained by deleting the ith row and jth column ofA.

    For example, if A =

    0B@ 1 4 51 2 72 3 4

    1CA then jA23j = 1 42 3

    = 11.We can now dene the determinant recursively as follows:

    Denition: The determinant of an n n matrix is

    jAj = a11jA11j a12jA12j+ a13jA13j + (1)n1a1njA1nj:

    This formula is sometimes referred to as expanding along the top row. Essentially, it saysthat we multiply each entry in the top row by the determinant of the matrix obtained bydeleting the row and column that the entry belongs to and then we take an alternating sumand dierence of all these quantities.

    13

  • Ex: Find the determinant of A =

    0B@ 1 4 51 2 72 3 4

    1CA.

    For 4 4 matrices (and higher orders), we have to apply this denition iteratively.There is, however, a more ecient method of nding the determinant which we shall see later.

    Properties of the Determinant:

    Suppose A and B are n n matrices then

    (i) jABj = jAjjBj.

    (ii) jAj = jAT j.

    (iii) jIj = 1.

    (iv) jA1j = 1jAj assuming that jAj 6= 0.

    Proof of (iv): AA1 = I so jAA1j = jIj. Now using (i) and (iii) we see that this isequal to jAjjA1j = 1 and the result follows.

    In the light of property (ii), we can see that we can change the denition of determinantslightly and expand down the rst column instead of the across the rst row. This can bevery useful calculationally, for example:

    The deteminant

    1 4 50 2 70 3 4

    = 1 2 73 4

    = 29, since if we expand down the rst col-umn, the other minors are multiplied by zero.

    14

  • Ex: Suppose jAj = 3; jBj = 2, and A, B are square matrices of the same size.Simplify jA2BT (B1)2A1Bj:

    Further Properties of the Determinant:

    (i) jAj = 0 if and only if A is NOT invertible.

    (ii) If A has a row or column of zeros then jAj = 0.

    (iii) If A has two rows or columns which are multiples of each other then jAj = 0.

    (iv) If a row or column of A is multiplied by a scalar then the determinant of A ismultiplied by . Note that if A is an n n matrix, then jAj = njAj.

    (v) If we swap two rows or two columns of A then the determinant of the resultingmatrix is 1 times jAj.

    (vi) If U is in row echelon form, then jU j is simply the product of the diagonal en-tries.

    (vii) If U is the row-echelon form of A, which was achieved using only row swaps and rowsubtractions then jAj = jU j, where = 1 if there was an even number of row swaps and 1if there was an odd number of row swaps.

    For some proofs of these results, see the Algebra Notes.

    From these results, we can nd an ecient method to calculate the determinant of anysquare matrix.

    We take the matrix A and reduce it to row echelon form U , making sure that we do NOTmake any row swaps and we do not divide any row by a common factor of entries, thenjAj = jU j and the latter is simply the product of the diagonal entries. If it is necessary (orconvenient) to make a row swap or to divide a row by a common factor, then we can takethat into account using the above rules.

    15

  • Ex: Find

    1 2 32 5 31 0 8

    .

    Ex: Find

    1 1 0 32 2 6 14 2 1 73 5 7 2

    .

    16

  • Determinants and Equations:

    We nish this section by putting together a number of ideas. If we are looking at thesolution of Ax = b, where A is a square matrix, then we can see that if A is invertible, wecould multiply both sides by A1 and obtain the unique solution x = A1b. Thus, we canconclude:

    Theorem: Suppose A is a square matrix. Then Ax = b has a unique solution if A isinvertible which is true if and only if det(A) 6= 0. If A is not invertible, i.e. if det(A) = 0,then the system may have no solution or innitely many solutions.

    Ex: Without solving, determine whether or not Ax = b has a unique solution if A =0B@ 1 1 32 3 13 1 4

    1CA :

    17