basic matrix operations matrix – a rectangular array of numbers, variables, and both order...

29
Basic Matrix Operations Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a matrix 2 4 5 6 3 7 8 10 Row 1 Row 2 Column 1 Column 2 Column 3 Column 4 This is a 2 x 4 matrix. Rows Columns

Upload: dayna-malone

Post on 18-Jan-2016

244 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Basic Matrix OperationsBasic Matrix Operations

Matrix – a rectangular array of numbers, variables, and both

Order (dimensions) – describes the number of rows and columns in a matrix

2 4 5 6

3 7 8 10

Row 1

Row 2

Column

1 Column

2 Column

3 Column

4

This is a 2 x 4 matrix.

Rows

Columns

Page 2: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

VinsVins TonisTonis SalsSalsPizzaPizza $10.10$10.10 $10.86$10.86 $10.65$10.65

A = A = DrinksDrinks $1.09$1.09 $0.89$0.89 $1.05$1.05SaladSalad $3.69$3.69 $3.89$3.89 $3.85$3.85

Interpret the values for AInterpret the values for A1212 , A , A2121, and A, and A3232..

A12 says the price of a pizza at Tonis is $10.86

Element – each individual entrynotation – A mn : A is the name of the matrix, m is the row number and n is column number.interpretation – what the number represents, describe in words

A21 says the price of drinks at Vins is $1.09A32 says the price of salad at Tonis is $3.89

Page 3: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Square matrix – a matrix, where the rows and columns are equal

Column matrix – a matrix

made up of just one column

and any number of rows

Row matrix – a matrix made up of just one row and any number of columns

23 65

12 -52

12

14

62

121 145 324 365

Page 4: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Adding and subtracting matrices – (matrices of the same dimensions can be added or subtracted) add or subtract the element of the first matrix by the element of the second matrix in the same position and the answer goes in that same position in the matrix that is representing the answer.

2 3 4 -5

-6 7 8 9 + =

2 + 4 3 + -5

-6 + 8 7 + 9

6 -2

2 16=

Page 5: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Main diagonal – the elements whose row number and column number are the same.

Zero matrix – a matrix of any dimensions made up of all zeros

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

0 0 0

0 0 0

Page 6: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Scalar Multiplication – (think Distributive Property for Matrices) the element of the matrix are multiplied by a value outside of the matrix

8 23

-11 16

5 40 115

-55 80=

Page 7: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Matrix Multiplication – In order to multiply two matrices the columns of the first matrix must be equal to the rows of the second matrix.

[A] x [B] (m x k) (k x n)

When doing word problems, make sure the labels of the rows and columns you are multiplying match as well as the numbers.

Page 8: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

A group of friends are going out for pizza. Given are the ordering options and the prices for pizza and salad at the two pizza places.

Option 1 Option 2

Pizza 4 2

Salad 6 8

Vin’s Toni’s

Pizza 11.25 11.95

Salad 3.69 2.85

Find the cost of each option at each of the two pizza places.

= [A] = [B]

Page 9: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

= [A] = [B]

First take [A][B]. Why is this wrong?

Option 1 Option 2

Pizza 4 2

Salad 6 8

Vin’s Toni’s

Pizza 11.25 11.95

Salad 3.69 2.85

4 2

6 8

11.25 11.95

3.69 2.85

( 4 P Opt1)(11.25 P @V) + (2 P Opt 2)(3.69 S @V)

The labels in the second product do not match each other

How do we fix this?

Page 10: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

4 2

6 8

11.25 11.95

3.69 2.85

We need to Transpose the first matrix.

11.25 11.95

3.69 2.85

4 6

2 8

And now multiply the two matrices together

( 4 P Opt1)(11.25 P @V) + (6 S Opt 1)(3.69 S @V)

Now all of the labels match in the product

for Row 1 Column 1

Page 11: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Multiplication of a Column by a RowMultiplication of a Column by a Row

A = 4 5 8 B = 2

6

9Now, lets multiply A x B.

4 5 8

2

6

9

4 (2) + 5 (6) + 8(9) = 110

1 x 3 3 x 1=

Page 12: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Transpose – ( A T ) of the matrix A is the matrix obtained by interchanging the rows and columns of matrix A.

1 2 3

4 5 6A = AT =

1 4

2 5

3 6

The transpose function is in the Matrix catalog, MATH column and the second choice down.

Page 13: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

If the matrices pass the first test of the columns in the first being equal to the rows in the second use the following steps to multiply.

A B2 3 4 5

6 7 8 9

Take the numbers in the first row of matrix A times the numbers in each of the columns in matrix B. Then do the same for the numbers in the second row of matrix A times the numbers in each of the columns in matrix B.

2(4) + 3(8) 2(5) + 3(9) 32 37

6(4) + 7(8) 6(5) + 7(9) 80 93

Page 14: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Inverse – we use the inverse of a matrix when we need to divide it is denoted as A-1

Some of you may remember using a formula to find the inverse in Algebra 2 but in this class we will use the inverse button on the calculator (fourth button down on left hand side of calculator)

Identity Matrix – this acts like the number one for matrices, denoted with a capital I. This matrix must be a square matrix and have the number one in the main diagonal and 0’s everywhere else.

Example: 1 0 or 1 0 0

0 1 0 1 0

0 0 1

Page 15: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Leslie Growth ModelLeslie Growth ModelThe Leslie Growth Model is used to predict The Leslie Growth Model is used to predict

population levels at different age distributions.population levels at different age distributions.Needed InformationNeeded Information:: The length of each cycle (how long an animal is in The length of each cycle (how long an animal is in

each age group)each age group) The birthrate in each of the cyclesThe birthrate in each of the cycles The survival rate of each of the cyclesThe survival rate of each of the cycles The initial distribution in each of the cycles.The initial distribution in each of the cycles.

(birthrate and survival rates will remain constant in the (birthrate and survival rates will remain constant in the problems and only the female population is tracted)problems and only the female population is tracted)

Page 16: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Population GrowthPopulation GrowthSuppose that a certain animal has the following birthrate,

survival rate, and population distribution.

Age (yrs) Birthrate Survival Distribution

0-2 0 0.8 25

2-4 0.7 0.7 32

4-6 1.5 0.7 15

6-8 1.5 0.6 12

8-10 0.4 0 10

a.) Find the population distribution for the next two cycles.

b.) Find the growth rate for each cycle.

Page 17: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Finding the population distribution Finding the population distribution after one cycleafter one cycle

Step 1: Multiply the distribution in each cycle times Step 1: Multiply the distribution in each cycle times

the birthrate for the corresponding cyclethe birthrate for the corresponding cycle

and add all the productsand add all the products

25(0) + 32(.7) + 15(1.5) + 12(1.5) + 10(.4) = 66.9025(0) + 32(.7) + 15(1.5) + 12(1.5) + 10(.4) = 66.90

(round all numbers to 2 decimal places)(round all numbers to 2 decimal places)

This number (66.90) will be the number of newborns This number (66.90) will be the number of newborns (age 0-2) after one cycle.(age 0-2) after one cycle.

Page 18: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Age (yrs)Age (yrs) BirthrateBirthrate SurvivalSurvival Distribution Cycle Distribution Cycle 11

0-20-2 0 0.8 25 0 0.8 25 66.9 66.9

0-4 0.7 0.7 320-4 0.7 0.7 32

4-6 1.5 0.7 15 4-6 1.5 0.7 15

6-8 1.5 0.6 126-8 1.5 0.6 12

8-10 0.4 0 108-10 0.4 0 10

Now, we need to find out many of the animals in each Now, we need to find out many of the animals in each distribution survived and move to the next highest distribution survived and move to the next highest age group.age group.

Page 19: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Find the number of animals that survive Find the number of animals that survive to live another day.to live another day.

Step 2: Multiply the numbers of animals that start in Step 2: Multiply the numbers of animals that start in the first age group times the survival rate in that the first age group times the survival rate in that group and place this number in the next highest age group and place this number in the next highest age group (one row down the chart)group (one row down the chart)

25 (.8) = 20 (these are the animals that are now 2-4 25 (.8) = 20 (these are the animals that are now 2-4 years old)years old)

32 (.7) = 22.4 (these are the animals that are now 4-6)32 (.7) = 22.4 (these are the animals that are now 4-6)

Page 20: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Age (yrs)Age (yrs) BirthrateBirthrate SurvivalSurvival Distribution Cycle Distribution Cycle 11

0-20-2 0 0.8 25 0 0.8 25 66.9 66.9

0-4 0.7 0.7 320-4 0.7 0.7 32 20 20

4-6 1.5 0.7 15 4-6 1.5 0.7 15 22.4 22.4

6-8 1.5 0.6 126-8 1.5 0.6 12

8-10 0.4 0 108-10 0.4 0 10

Now, fill in the rest of the chart in the same manner.Now, fill in the rest of the chart in the same manner.

x

x

Page 21: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

15 ( .7) = 10.515 ( .7) = 10.5

12 ( .6) = 7.212 ( .6) = 7.2

10 ( 0 ) = 0 (the last one will always be zero because 10 ( 0 ) = 0 (the last one will always be zero because this is the life expectancy of the animals) this is the life expectancy of the animals)

Page 22: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Age (yrs)Age (yrs) Birthrate Birthrate SurvivalSurvival Distribution Distribution Cycle 1Cycle 1

0-20-2 0 0.8 25 0 0.8 25 66.90 66.90

0-4 0.7 0.7 320-4 0.7 0.7 32 20 20

4-6 1.5 0.7 15 22.44-6 1.5 0.7 15 22.4

6-8 1.5 0.6 12 10.56-8 1.5 0.6 12 10.5

8-10 0.4 0 10 7.28-10 0.4 0 10 7.2

Page 23: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Find the Growth RateFind the Growth Rate

New – Old

Old

= Growth RateDistributionDistribution Cycle 1Cycle 1

2525 66.90 66.90 3232 20 2015 22.415 22.412 10.512 10.510 10 7.27.29494 127 127

127 – 94

94

Cycle 1 = .35 or 35%

Page 24: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Now, use the Cycle 1 numbers and the given birth and survival rates to find the age distribution for Cycle 2 and the Growth Rate.

Page 25: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Age (yrs) BR SR Dist Cycle 1 Cycle 2

0-2 0 0.8 25 66.90 66.23

2-4 0.7 0.7 32 20 53.52

4-6 1.5 0.7 15 22.4 14

6-8 1.5 0.6 12 10.5 15.68

8-10 0.4 0 10 7.2 6.3

Page 26: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Population GrowthPopulation GrowthSuppose that a certain animal has the following birthrate, survival Suppose that a certain animal has the following birthrate, survival

rate, and population distribution.rate, and population distribution.Age (yrs)Age (yrs) BirthrateBirthrate SurvivalSurvival DistributionDistribution

0-20-2 0 0.7 20 0 0.7 202-4 0.8 0.8 152-4 0.8 0.8 154-6 0.9 0.9 23 4-6 0.9 0.9 23 6-8 1.2 0.5 176-8 1.2 0.5 178-10 0.5 0.4 88-10 0.5 0.4 8

10-1210-12 0.2 0.2 0.3 5 0.3 5 12-1412-14 0 0 5 0 0 5

a.) Find the distribution for the next three cycles.a.) Find the distribution for the next three cycles.b.) Find the growth rate for the next three cycles.b.) Find the growth rate for the next three cycles.c.) After how many cycles will the population be over 1,000,000?c.) After how many cycles will the population be over 1,000,000?

Page 27: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Leslie Matrices in the calculatorLeslie Matrices in the calculatorThe population distribution is a row matrix [A]The population distribution is a row matrix [A]

The birth and survival rates make up the Leslie matrix. The birth and survival rates make up the Leslie matrix. ( (will always be a square matrixwill always be a square matrix))

The birthrates are the first column and the survival The birthrates are the first column and the survival rates and zeros make up the other columns. The rates and zeros make up the other columns. The survival rate go in the super diagonal (one above the survival rate go in the super diagonal (one above the main diagonal) and zeros are all other elements of main diagonal) and zeros are all other elements of the matrix.the matrix.

Page 28: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

[A] = [ 20 15 23 17 8 5 5 ][A] = [ 20 15 23 17 8 5 5 ]

[B] = [B] = 00 0.7 0 0 0.7 0 0 0 0 0 0 0 0

0.8 0 0.8 0 0 0 00.8 0 0.8 0 0 0 0

0.9 0 0 0.9 0 0 00.9 0 0 0.9 0 0 0

1.2 0 0 0 0.5 0 01.2 0 0 0 0.5 0 0

0.5 0 0 0 0 0.4 00.5 0 0 0 0 0.4 0

0.2 0 0 0 0 0 0.30.2 0 0 0 0 0 0.3

0 0 0 0 0 0 00 0 0 0 0 0 0

Now, [A][B] = Cycle 1

[A][B]2 = Cycle 2

Page 29: Basic Matrix Operations Matrix – a rectangular array of numbers, variables, and both Order (dimensions) – describes the number of rows and columns in a

Total PopulationTotal PopulationMake another matrix [C], this is a column matrix with all 1’s Make another matrix [C], this is a column matrix with all 1’s

for elements. This matrix will have as many rows as the for elements. This matrix will have as many rows as the distribution matrix had columns.distribution matrix had columns.

For this example: [C] =For this example: [C] = 11

11

11

11

11

11

11[A][B][C] = Total Population for Cycle 1[A][B]2[C] = Total Population Cycle 2