Matrix Intro

Download Report

Transcript Matrix Intro

Algebra 2 – matrices intro
Ms. Riling’s matrix
FOOD TYPE
BEEF
OTHER
MEAT
DAIRY
FRUITS AND BREADS,
VEGGIES
COOKIES
BREAKFAST
0
0
0
5
8
LUNCH
0
0
0
5
7
DINNER
0
0
0
2
9
DESSERT
0
0
0
5
2
OTHER
0
0
2
12
6
W’s matrix
FOOD TYPE
BEEF
OTHER
MEAT
DAIRY
FRUITS AND BREADS,
VEGGIES
COOKIES
BREAKFAST
0
4
6
5
3
LUNCH
5
0
3
5
5
DINNER
4
0
0
2
2
DESSERT
0
0
0
5
2
OTHER
0
0
1
4
3
1. What if there were 10 people who ate JUST like
you?
-Make one matrix representing what you all ate
2. With a partner, figure out how much you ate in
total
-Make one matrix for the data
3. A matrix for the food you and your partner would
eat over 2 days
4. You buy exactly the amount of food you need.
Your partner eats it, following their usual eating
habits.
-Write a matrix for what’s left. (If they need extra, write
how much more it should be, but make it negative to
differentiate)
Matrices
• Definition: a 2D array of data
a rectangular arrangement of
numbers in rows and columns
• Dimensions: An “n x m matrix” has n rows and
3 columns
5 2 11


9
4
5
2 3 4 2 4 




2 9 8 
8 1 6 7 5 


 3 1 6 
• Equal matrices: matrices with the same
dimensions, and the same entry in every spot
• Nomenclature: we refer to matrices using
capital letters – typically A, B, C
Matrix Elements
• Each number in the matrix is called an ELEMENT
• To identify it:
– Describe which row and column it is in
1 4 7 
A  2 5 8
3 6 9
a23  8
a21  __
a33  __
• We always describe rows first, then columns
Adding and subtracting matrices
• Just add or subtract the
numbers in the same positions
• What needs to be true about two
matrices if you want to add
them together?
a b   e
c d    g

 
f  a  e b  f 


h  c  g d  h 
a b   e
c d    g

 
f  a  e b  f 


h  c  g d  h 
• Let’s try some subtraction:

23 9 7.1  4 10 .1 
 0 3 6   70 3 1   

 
 





Scalar Multiplication
• How did you create a matrix describing the food 10 people just like you
ate?
• Scalar: a number you multiply the matrix by
* Always write the scalar to the matrix’s left
• Just multiply all the elements by the scalar:
2 5 4  2 4  5  8 20
4





3
1
4

3
4

1
12
4

 
 

• Try one:
6
3
 2
1

0
1

2

0

1
Rules of Arithmetic
• Associative Property: (A + B) + C = A + (B + C)
• Commutative:
Now, about food…
• How much land did each meal use up?
• We can measure the land that were needed to produce your
food. That depends on the animals involved, the food they
ate, the machines used, etc.
• Since we didn’t measure whether your food was
local/organic/etc, we aren’t going to be very precise.
The units
• We measure land in HECTARES (ha)
• 1 ha = about 2.5 acres
The Data
FOOD
HECTARES USED PER
OUNCE OF FOOD
Beef
.0157
Other meat
.0032
Dairy
.0115 (Note: milk is
actually less)
.0004
Fruits and veggies
Baked things
.0015 (Note: bread is
actually less)
Matrix Multiplication
• We want to multiply each food type by the
amount of ha that food type uses.
• You created a matrix representing the food
you ate:
0 0 8

3 0 0
0 3 3

0 0 3
0 0 2
• Now make onefor
land use:
3
6
9
5
3
3
2 
5

0
5 
.0157
.0032


.0115


.
0004


.0015
 Now we just have to multiply them:
0

3
0

0
0
0
0
3
0
0
8
0
3
3
2
3
6
9
5
3
3
2 
5

0
5 
.0157
.0032


.0115


.
0004


.0015
.0977
.0525


.0252


.
0365


.0317
 What does each row in your new matrix
represent?
 Other thoughts?
Multiplying Matrices
a b   e
c d    g

 
f  ae  bg


h  ce  dg
af  bh

cf  dh 
 Say we multiply matrices A and B to get a new matrix, C
 To get element cmn, you need to multiply
row m in A
by
column n in B
Practice – multiplying matrices
5 
 
7 

3 2 6 11 
 
9 


6 4 

5 

1 8 
2


3 2 
5 
4 3 5 17

 
3 1 2 7 1 
 
9 


1 5 
2 1 4 


2 2
6 4 3 

0 1 

More practice
5 61 3



2 34 2 
5 
1 3 


3
4 2 

6 




1 35 6



4 2 2 3
 6 2 2


2 5 13 1 1

4 0 1

 What needs to be true about two matrices if you want to
multiply them?
 Does the order of the matrices matter?
 What size will the solution matrix be?