Matrix

A Matrix is an array of numbers, 2 rows and 3 columns 2 X 3

6  4 24
1 -9 8

Adding (same as subtracting) – A matrix with 3 X 5 +  3 X 5, but 3 X 5 # 3 X 4 (the columns don’t match in size).

 3 8 + 4  0 => 3+4 8+0 => 7  8
 4 6   1 -9    4+1 6-9    5 -3

Negative

- 6  4 24 = -6 -4 -24
  1 -9 8    -1  9 -8

Multiply – m X n * n X p = m X p
The running time of matrix multiplication is 0(n³), because looping through for each of the entries of this matrix that to fill in and there’s n² to them, this row by column multiplication which also takes time in. So it’s in cubed.

by a Constant

2 * 4  0 = 8 0
    1 -9   2 -18

by Another Matrix

1 2 3 *  7 8 =  58  64
 4 5 6   9 10  139 154
        11 12

1*7 + 2*9 + 3*11 = 58
1*8 + 2*10 + 3*12 = 64
4*7 + 5*9 + 6*11 = 139
4*8 + 5*10 + 6*12 = 154
Real time example – Sells 3 types of pies, $3 Beef, $4 Chicken and $2 Veg, 4 days sale is:

         Mon Tue Wed Thu
 Beef     13   9   7  15
 Chicken   8   7   4   6
 Veg       6   4   0   3

The pies sales for Monday were: Beef: $3×13=$39, Chicken: $4×8=$32, and Veg: $2×6=$12, total is $39 + $32 + $12 = $83
And for Tueday: $3*9 + $4*7 + $2*4 = $63
And for Wednesday: $3*7 + $4*4 + $2*0 = $37
And for Thursday: $3*15 + $4*6 + $2*3 = $75
The Matrix form is – 1 X 3 * 3 X 4 = 1 X 4

 3 4 2 * 13 9 7 15 = 83 53 37 75
          8 7 4 6
          6 4 0 3

AB not equal to BA, example

 1 2 * 2 0 =  4 4  #   2 0 * 1 2 = 2  4
 3 4   1 2   10 8      1 2   3 4   7 10

Identitty (I) matrix A X I = I X A = A ,example 3X3 identity matrix

 1 0 0
 0 1 0
 0 0 1

Dividing – A / B = A * (1/B) = A * B-1, B-1 means inverse of a matrix B. No concept of diving by a matrix,so write A-1 for the inverse:
Transposing (T) or Symmetric – To “transpose” a matrix, swap the rows and columns.

 6 4 24 => 6  1
 1 -9 8    4 -9
          24  8

A * A-1 => A * 1/A => = I
Calculate the Inverse , example 2 X 2 matrix, swap the positions of a and d, put negatives in front of b and c, and divide everything by the determinant (ad-bc).

a b-1 = 1/(ad-bc) * d -c
c d                -b a
4 7-1 => 1/(4*6-7*2) * 6 -7 => 1/10 * 6 -7 => .6 -.7
2 6                   -2  4          -2  4    -.2 .4

A * A-1 OR A-1 * A = I

 4 7 * .6 -.7 => 4*.6+7*(-.2) 4*(-.7)+7*.4 => 2.4-1.4 -2.8+2.8 => 1 0
 2 6   -.2 .4    2*.6+6*(-.2) 2*(-.2)+6*.4    1.2-1.2 -4.0+3.2    0 1

Real time example – Share 10 apples with 2 people? the reciprocal of 2 (which is 0.5), so you could answer: 10 × 0.5 = 5
Find Matrix Z: Z*A = B => Z=B/A (can’t divide)
multiply both sides by A-1, Z*A*A-1 = B*A-1 = >  ZI = B*A-1 => Z = B*A-1, we know A * A-1 = I and A X I = A

Real time example – A group took a trip on a bus, at $3 per child and $3.20 per adult for a total of $118.40. They took the train back at $3.50 per child and $3.60 per adult for a total of $135.20. How many children’s and adults?
First, let us set up the matrices, same like above Z*A = B

child adult bus train => bus  train
 z1   z2    3   3.5     118.4 135.2
            3.2 3.6

Find the inverse of “A”:

 3   3.5-1 => 1/(3*3.6-3.5*3.2) * 3.6 -3.5 => -9 8.75
 3.2 3.6                             -3.2  3       8 -7.5

Z = B*A-1

z1 z2 = 118.4 135.2 * -9 8.75 => 118.4*-9+135.2*8 118.4*8.75+135.2*-7.5 => 16 22
                       8 -7.5

There were 16 children and 22 adults.
The Inverse May Not Exist
1)An Inverse the Matrix must be “Square” (same number of rows and columns).
2)The determinant cannot be zero, for example

3 4-1 => 1/24-24 * 8 -4
6 8               -8 3

If the matrix has no Inverse, it called “Singular” Matrix, which only happens when the determinant is zero.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: