matrix in computing

Upload: misteryfollow

Post on 03-Mar-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/26/2019 Matrix in Computing

    1/33

    Page 1

    Matrix for Business

  • 7/26/2019 Matrix in Computing

    2/33

    Page 2

    Matrices

    A matrix consisting of m horizontal rows and n

    vertical columns is called anm

    n matrix

    or amatrix of size mn.

    For the entry aij, we call i the row subscript andjthe column subscript.

    mnmm

    n

    n

    aaa

    aaa

    aaa

    ...

    ......

    ......

    ......

    ...

    ...

    21

    21221

    11211

  • 7/26/2019 Matrix in Computing

    3/33

    Page 3

    a.he matrix has size .

    b.he matrix has size .

    c.he matrix has size .

    d.he matrix has size .

    Chapter 3: Matrix Algebra

    Matrices

    Example 1 Size of a Matrix

    [ ]!21 "1

    #$

    1%

    &1

    2"

    [ ]' 11

    1112&

    (&%11$

    #2'"1

    %"

  • 7/26/2019 Matrix in Computing

    4/33

    Page 4

    Eqalit! of Matrices

    )atrices A * +aij and " * +bij are eqalifthey have the same size and aij * bijfor

    each iandj.#ra$spose of a Matrix

    A tra$spose matrix is denoted by A.

    If , find .

    -olution

    /bserve that

    TA

    =

    &%#

    "21A

    =

    &"

    %2

    #1TA

    ( ) AA TT =

  • 7/26/2019 Matrix in Computing

    5/33

    Page %

    Matrix A&&itio$ a$& Scalar Mltiplicatio$

    Example 1 Matrix A&&itio$

    Matrix A&&itio$ Sm A 0 " is the m nmatrix obtained by adding

    corresponding entries of A and ".

    a.

    b. is impossible as matrices are not of the same

    size.

    +

    1

    2

    #"

    21

    =

    ++

    ++

    =

    +

    68

    83

    08

    0635

    4463

    2271

    03

    46

    27

    65

    43

    21

  • 7/26/2019 Matrix in Computing

    6/33

    Page '

    Example 2 Matrix Sbtractio$

    a.

    =

    + +=

    1"

    !(

    (#

    "2!"

    11##

    2&&2

    "!

    1#

    2&

    2"

    1#

    &2

  • 7/26/2019 Matrix in Computing

    7/33

    Page (

    Example 3 )ema$& *ectors for a$ Eco$om!

    Demand for the consumers is

    For the industries is

    What is the total demand for consumers and the

    industries?

    -olution

    otal

    [ ] [ ] [ ]12'!%2" "21 === DDD

    [ ] [ ] [ ]!%"!(!2!#1! === SEC

    DDD

    [ ] [ ] [ ] [ ]1(2%'12'!%2""21

    =++=++ DDD

    [ ] [ ] [ ] [ ]12&%!!%"!(!2!#1! =++=++ SEC

    DDD

    [ ] [ ] [ ]"!"1%'12&%!1(2%' =+

  • 7/26/2019 Matrix in Computing

    8/33

    Page +

    Scalar Mltiplicatio$

    roperties of -calar )ultiplication

    Sbtractio$ of Matrices

    roperty of subtraction is ( )AA 1=

  • 7/26/2019 Matrix in Computing

    9/33

    Page ,

    To multiply matrices Aand B

    look at their dimensions

    )- 34 -A)4

    -564 /F 7/89

    5f the number of columns ofAdoes note:ual the number of rows of Bthen theproductABis undefined.

    pnnm

  • 7/26/2019 Matrix in Computing

    10/33

    Page 1-

    Multiplication of Matrices#he mltiplicatio$ of matrices is easier sho.$ tha$ pt

    i$to .or&s/ 0o mltipl! the ro.s of the first matrix

    .ith the colm$s of the seco$& a&&i$g pro&cts

    Find AB

    irst .e mltipl! across the first ro. a$& &o.$ the

    first colm$ a&&i$g pro&cts/ e pt the a$s.er i$

    the first ro. first colm$ of the a$s.er/

    =

    140123A

    =

    13

    31

    42

    B

    ( )23( ) ( ) ( )1223 +( ) ( ) ( ) ( ) ( ) ( ) 5311223 =++

  • 7/26/2019 Matrix in Computing

    11/33

    Page 11

    Find AB

    e mltiplie& across first ro. a$& &o.$ first colm$

    so .e pt the a$s.er i$ the first ro. first colm$/

    o. .e mltipl! across the first ro. a$& &o.$ the seco$&

    colm$ a$& .e5ll pt the a$s.er i$ the first ro. seco$&colm$/

    o. .e mltipl! across the seco$&ro. a$& &o.$ the first

    colm$ a$& .e5ll pt the a$s.er i$ the seco$& ro. firstcolm$/

    o. .e mltipl! across the seco$&ro. a$& &o.$ the

    seco$& colm$ a$& .e5ll pt the a$s.er i$ the seco$& ro.seco$& colm$/

    Notice the sizes of Aand Band the size of the product AB.

    = 140123

    A

    =

    13

    31

    42

    B

    = 5AB ( ) ( )43( ) ( ) ( ) ( )3243 +( ) ( ) ( ) ( ) ( ) ( ) 7113243 =++

    = 75AB ( ) ( )20( ) ( ) ( ) ( )1420 +( ) ( ) ( ) ( ) ( ) ( ) 1311420 =++

    =1

    75AB ( ) ( )40( ) ( ) ( ) ( )3440 +( ) ( ) ( ) ( ) ( ) ( ) 11113440 =++

    =111

    75AB

  • 7/26/2019 Matrix in Computing

    12/33

    Page 12

    o. let5s loo6 at the pro&ct "A/

    2332 ca$mltipl!

    sizeofa$s.er

    across first row as

    we go down first

    colun!

    across first row as

    we go down

    second colun!

    across first row as

    we go down third

    colun!

    across second row

    as we go down

    first colun!

    across second row

    as we go down

    second colun!

    across second row

    as we go down

    third colun!

    across third row

    as we go down

    first colun!

    across third row

    as we go down

    second colun!

    across third row

    as we go down

    third colun!

    Completel! &iffere$t tha$AB7

    Commuter's Beware!

    =

    6

    BA

    =

    126

    BA

    =

    2126

    BA

    = 3

    2126

    BA

    = 143

    2126

    BA

    = 4143

    2126

    BA

    =

    "

    4143

    2126

    BA

    =

    10"

    4143

    2126

    BA

    =

    410"

    4143

    2126

    BA

    =

    13

    31

    42

    B = 140123

    A

    BAAB

    ( ) ( ) ( ) ( ) 60432 =+( ) ( ) ( ) ( ) 124422 =+( ) ( ) ( ) ( ) 21412 =+( ) ( ) ( ) ( ) 30331 =+( ) ( ) ( ) ( ) 144321 =+( ) ( ) ( ) ( ) 41311 =+( ) ( ) ( ) ( ) "0133 =+( ) ( ) ( ) ( ) 104123 =+( ) ( ) ( ) ( ) 41113 =+

  • 7/26/2019 Matrix in Computing

    13/33

    Page 13

    Chapter 3: Matrix Algebra

    Matrix Mltiplicatio$

    Example 3 Matrix Pro&cts

    a.

    b.

    c.

    d.

    [ ] [ ]326

    5

    4

    321 =

    [ ]

    =

    183122

    61

    6132

    1

    =

    1047

    014

    1135

    212

    312

    201

    401

    122

    031

    ++++

    =

    2222122121221121

    2212121121121111

    2221

    1211

    2221

    1211

    babababa

    babababa

    bb

    bb

    aa

    aa

  • 7/26/2019 Matrix in Computing

    14/33

    Page 14

    Example % Cost *ector

    i!en the "rice and the #uantities, calculate the total

    cost.

    -olutionhe cost vector is

    [ ]#"2=$

    9ofunits

    3ofunits

    Aofunits

    11

    %

    '

    =%

    [ ] [ ]'"11

    %

    '

    #"2 =

    =$%

  • 7/26/2019 Matrix in Computing

    15/33

    Page 1%

    Exercise Cost *ector

    i!en the "rices &in dollars "er unit' for three

    te(tboo)s are re"resented b* the "rice !ector. A

    uni!ersit* boo)store orders these boo)s in the

    #uantities +i!en b* the column !ector %. find the total

    cost &in dollars' of the "urchase.

    22,(#".'%

    [ ]50.2875.3425.26=P

    =

    175

    325

    250

    Q

    Ch t 3 M t i Al b

  • 7/26/2019 Matrix in Computing

    16/33

    Page 1'

    Chapter 3: Matrix Algebra

    Matrix Mltiplicatio$

    Example ( Associati8e Propert!

    If

    com"ute A"C in to a*s.

    -olution 1 -olution 2

    ;ote that A

  • 7/26/2019 Matrix in Computing

    17/33

    Page 1(

    Chapter 3: Matrix Algebra

    Matrix Mltiplicatio$

    Example 11 Matrix 9peratio$s $8ol8i$g a$& 9

    If

    com"ute each of the folloin+.

    -olution

    !!

    !!

    1!

    !1

    #1

    2"

    1!

    "

    1!

    1

    %

    1

    %

    2

    =

    =

    =

    = -IBA

    "1

    22

    #1

    2"

    1!

    !1

    a.

    =

    = AI

    ( )

    =

    =

    =

    &"

    &"

    2!

    !2

    #1

    2""

    1!

    !12

    #1

    2""2"b. IA

    -A- =

    =

    !!

    !!

    #1

    2"c.

    IAB =

    =

    =

    1!

    !1

    #1

    2"d.

    1!

    "

    1!

    1

    %

    1

    %

    2

    Chapter 3: Matrix Algebra

  • 7/26/2019 Matrix in Computing

    18/33

    Page 1+

    Chapter 3: Matrix Algebra

    Matrix Mltiplicatio$

    Example 13 Matrix orm of a S!stem ;si$g Matrix Mltiplicatio$

    Write the s*stem

    in matri( form b* usin+ matri( multi"lication.

    -olution5f

    then the single matrix e:uation is

    =+

    =+

    '"(

    #%2

    21

    21

    ((

    ((

    =

    =

    =

    '

    #

    "(

    %2

    2

    1B

    (

    (.A

    =

    =

    '

    #

    "(

    %2

    2

    1

    (

    (

    BA.

  • 7/26/2019 Matrix in Computing

    19/33

    Page 1,

    Example , style houses, seven 9ape 9od stylehouses, and nine colonial style houses.his order represented by

    he raw materials that go into each type ofhouses are steel, wood, glass, paint, andlabor shown in the matrix 7.

  • 7/26/2019 Matrix in Computing

    20/33

    Page 2-

    -uppose that the contractor want to ?nowhow many amount of each raw material

    needed to fulfill the orders. he we shouldcompute the matrix @7.

    he contractor also interested in the costsfor the materials for each, shown in matrix9

    [ ]34"143236451128=QR

  • 7/26/2019 Matrix in Computing

    21/33

    Page 21

    hen, the cost of each type of house is given bymatrix

    9onse:uently, the total costs of materials forranch style '%,(%!B cape 9od style (1,%%!Band colonial style '1,&%!

    he total cost of raw materials for all the houses

    is

    he total costs is 1,%$#,$%!

    =

    =

    '1&%!

    (1%%!

    '%(%!

    1%!!

    1%!

    (!!

    12!!

    2%!!

    1"%(2%&

    21$121('

    1''1&2!%

    /C

    ( ) [ ] [ ]"50#5"4#1

    71650

    81550

    75850

    "75 =

    == RCQQRC

    2 2

  • 7/26/2019 Matrix in Computing

    22/33

    Page 22

    $8erses 2x2 Matric

    Example 1 $8erse of a Matrix

    Chen matrix A" * , Ais an inverse of "

    and A is invertible/

    =

    2153B

    = 31

    52A

    Chapter 3: Matrix Algebra

  • 7/26/2019 Matrix in Computing

    23/33

    Page 23

    Chapter 3: Matrix Algebra

    $8erses i$& matrix :

    ad>bc * 5A5*determinant A

    Chapter 3: Matrix Algebra

  • 7/26/2019 Matrix in Computing

    24/33

    Page 24

    Chapter 3: Matrix Algebra

    $8erses i$& matrix :

    = 31

    52

    A

  • 7/26/2019 Matrix in Computing

    25/33

    Page 2%

    4xercises

    Find its inverse

    3 3

  • 7/26/2019 Matrix in Computing

    26/33

    Page 2'

    $8erses 3x3

    Find the minor of )atric A

    D 4liminate the first row andfirst coloumn, get 5)115

    5)115 * a22xa""E a2"xa"2

  • 7/26/2019 Matrix in Computing

    27/33

    Page 2(

  • 7/26/2019 Matrix in Computing

    28/33

    Page 2+

    ;ow do the adoint, that is the transposeof matrix cofactor )

    hen, do the determinant

  • 7/26/2019 Matrix in Computing

    29/33

    Page 2,

    4xample inverse matric "x"

    A *

    G *

    400

    030001

    300

    040

    0012

  • 7/26/2019 Matrix in Computing

    30/33

    Page 3-

    300

    040

    0012

  • 7/26/2019 Matrix in Computing

    31/33

    Page 31

    A>1

    4$100

    03$10

    001

  • 7/26/2019 Matrix in Computing

    32/33

    Page 32

    Find its inverse

    103

    010

    207

    @ i no 1

  • 7/26/2019 Matrix in Computing

    33/33

    Page 33

    @uiz no.1 Hababe?a property accepted orders for five ranch>style

    houses, two 9ape 9od style houses, and four colonial

    style houses. his order represented by

    he raw materials that go into each type of houses aresteel, wood, glass, paint, and labor shown in the matrix

    7.

    he contractor also interested in the costs for the

    materials for each, shown in matrix 9

    sing matrix multiplication, compute the total cost of raw

    materials