Presentation is loading. Please wait.

Presentation is loading. Please wait.

Student Handbook 1. Matrices A matrix (plural: matrices, not matrixes) is a rectangular array of numbers such as Matrices are useful when modelling a.

Similar presentations


Presentation on theme: "Student Handbook 1. Matrices A matrix (plural: matrices, not matrixes) is a rectangular array of numbers such as Matrices are useful when modelling a."— Presentation transcript:

1 Student Handbook 1

2 Matrices A matrix (plural: matrices, not matrixes) is a rectangular array of numbers such as Matrices are useful when modelling a variety of real-life problems, and are the abstract mathematical counterparts of array data structures in programming. 2

3 Matrix Entries In this section we show how to add and multiply matrices. We shall identify the numbers inside a matrix by their position. In matrix A = we may describe the number 1 as “the entry in the first row, first column”, or more precisely write a 11 = 1. 3

4 Matrix Entries Similarly a 12 = 2 is the entry in the first row, second column. More generally we write a ij for the entry in the i th row, j th column. Matrices come in different sizes. Since A has two rows and three columns, we call A a 2×3 or “2 by3” matrix. The size of a matrix determines what other matrices it can be added to or multiplied with. Matrices are equal if they are the same size and their corresponding entries are equal. 4

5 Addition Two matrices A and B of the same size can be added together and the sum A+B is obtained by adding the corresponding entries. For example 5

6 Addition However, the sum is not defined, since the first matrix is 3×2 but the second is 3 × 3. 6

7 Scalar Multiplication To multiply a matrix A by a scalar c just means that c is some real number and that we multiply every entry in A by c. Let A = and let c =, then 7

8 Scalar Multiplication The difference A - B of two matrices of the same size is just another way of writing A + (-1)B: 8

9 Matrix Multiplication If A is a k × m matrix and B is an m × n matrix, then the product C = AB is the k×n matrix whose entries are found as follows: To calculate c ij, take row i from matrix A and column j from matrix B, multiply the corresponding entries together, and add up the results. Note that AB is defined iff the number of columns of A matches the number of rows of B. 9

10 Matrix Multiplication For example is undefined, because the matrices to be multiplied are 3 × 2 and 3 × 2. So it is possible to have two matrices that can be added but not multiplied together. 10

11 Examples of Products where the matrices to be multiplied are 1 × 2 and 2 × 1, so that multiplication is defined and the product is 1 × 1. 11

12 Examples of Products where the matrices to be multiplied are 3 × 2 and 2 × 2, so that multiplication is defined and the product is 3 × 2. 12

13 Why? Let’s show, by a real-life example, why matrix multiplication is defined in such a strange way. Suppose a superannuation fund has investments in three countries. The deposits in each country are divided among government bonds, mortgages, and shares. Let’s represent the amount currently invested in each country, in millions of dollars, by the table 13

14 Why? Bonds Mortgages Shares Country A 5 10 20 Country B 3 9 15 Country C 2 6 10 The table can be simplified to the matrix X = 14

15 Why? Now suppose the average yields are 4% for bonds, 7% for mortgages, and 10% for shares. How would we work out the earnings the superannuation fund can expect from its investments in each country? 15

16 Why? The amount earned in Country A would be (amount invested in bonds)·(yield of bonds) + (amount in mortgages) ·(yield of mortgages) + (amount in shares) ·(yield of shares) = (5)(.04) + (10)(.07) + (20)(.10). This is like working out an entry in a matrix product. 16

17 Why? Let the yield matrix be Y = Then the amount earned in Country A is just the first entry of the product XY = 17

18 Why? and the earnings for the other countries are the second and third entries: The fund earns 2.9 million in Country A, 2.25 million in Country B, and 1.5 million in Country C. 18

19 Representing Systems of Equations Here is another use for products. The system of linear equations 2x - 3y = 5 4x + y = 0 can be represented compactly by the matrix equation: 19

20 Representing Systems of Equations which is of the form AX = B where 20

21 A Real Life Problem You have a bacteria culture containing three species of bacteria. Each species requires different amounts of three nutrients: nitrates, carbohydrates, and phosphates. The requirements are given in the table, in micrograms per day. Species Nitrates Carbohydrates Phosphates A 1 2 1 B 2 3 1 C 3 2 2 21

22 A Real Life Problem The daily supply of nitrates is 6000 units, of carbohydrates is 7000 units, and of phosphates is 4000 units. How many bacteria of each species can the culture grow? 22

23 Modelling the data Let x be the number of bacteria of species A, y the number of B, and z the number of C. We want to use our data to find the values of x, y, and z. But first we have to represent that data in a way that connects the information with the unknowns x, y, and z. This gives us a system of linear equations: 23

24 Modelling the data If the entire daily supply of 6000 units of nitrates is used up, then x + 2y + 3z = 6000. Similarly, from the data about carbohydrates we get 2x + 3y + 2z = 7000 and from the phosphate data we get x + y + 2z = 4000. 24

25 Solving Linear Equations In this section we show how matrices arise when solving systems of linear equations. Key concepts in this section: system of linear equations, augmented matrix, coefficient matrix, elementary transformation, echelon form, rank of a matrix. 25

26 Echelon Form We have the following system of equations to solve: x + 2y + 3z = 6000 2x + 3y + 2z = 7000 x + y + 2z = 4000 but it is unclear what values of x, y, and z would satisfy the equations. 26

27 Echelon Form So we transform this system into a new system which has the same solutions but is easier to solve. If the new system is in echelon form it is easy to solve: x + 2y + 3z = 6000 y + 4z = 5000 3z = 3000 Now z = 1000 and back-substituting gives y = 5000-4000 = 1000 and x = 6000-2000-3000 =1000. 27

28 Matrix Representation Suppose we are going to transform the system of equations into a new system in echelon form. It will reduce the labour if we simplify the representation. Instead of writing down the equations, we write down just the coefficients of the unknowns on the left and the constants on the right, giving us the augmented matrix of the system. 28

29 Matrix Representation So from the system x + 2y + 3z = 6000 2x + 3y + 2z = 7000 x + y + 2z = 4000 we get the augmented matrix 29

30 Elementary Transformations We can change a system of equations into a new system with the same solutions: by swapping equations or by multiplying through by a nonzero number or by adding one equation to another. In terms of the augmented matrix, this means we may: 30

31 Elementary Transformations interchange two rows: R j ↔ R k multiply through by a nonzero number: R j ⟶ c × R j add one row to another row: R j ⟶ R j + R k. In fact, we often combine the last two transformations so as to add a multiple of one row to another row: R j ⟶ R j + c × R k 31

32 Example The system of linear equations gives R 2 ⟶ R 2 - 2R 1 and then R 3 ⟶ R 3 - R 1 give 32

33 Example R 2 ⟶ (-1) R 2 and then R 3 ⟶ R 3 + R 2 give This matrix represents the system of equations x + 2y + 3z = 6000 y + 4z = 5000 3z = 3000 33

34 Example with solutions x = 1000, y = 1000, and z = 1000. By using elementary transformations to reduce the augmented matrix to echelon form. We get a new system of equations with the same solutions as the original system. The technique is called Gaussian elimination. 34

35 No Solutions? When the augmented matrix of a system of linear equations in n unknowns is reduced to echelon form, the last row may be of the form [0 … 0 c] with c ≠ 0 so that the corresponding equation is 0 x 1 + …+ 0 x n = c which has no solution, because no matter what values we substitute for the unknowns x 1, x 2, …, x n 35

36 No Solutions? The lefthand side still adds up to zero, whereas the righthand side is nonzero. But if the last row has at least one nonzero coefficient [0 …a n c] where a n ≠ 0 Then the system has at least one solution, irrespective of the value of c, since the final equation is 0x 1 + …+ a n x n = c 36

37 Infinitely Many Solutions Suppose our model was initially the system x + 2y + 3z = 6000 2x + 3y + 2z = 7000 which we reduced to echelon form to get x + 2y + 3z = 6000 y + 4z = 5000 37

38 Infinitely Many Solutions Instead of a unique value for z, we can let z be any real number t, and then get values for y and x in terms of t, namely y = 5000 - 4t and x = 6000 - 2(5000 - 4t) - 3t = 5t - 4000. We can produce specific solutions by giving t specific values such as t = 0 (so that x = -4000, y = 5000, and z = 0) and t = 1 (so that x = -3995, y = 4996, and z = 1). 38

39 Homogeneous Systems If the constants on the righthand side are all zero, as in the system x + 2y + 3z = 0 2x + 3y + 2z = 0 x + y + 2z = 0 then the system always has at least one solution, because we may take x = y = z = 0. Such systems of equations are called homogeneous. 39

40 Homogeneous Systems We need not use an augmented matrix to represent a homogeneous system, since the last column will consist entirely of zeros. Instead we may use the coefficient matrix in which only the values of the coefficients of the unknowns are displayed: 40

41 Rank The rank of a matrix is the number of nonzero rows left after the matrix has been reduced to echelon form. A system of linear equations has a solution iff the rank of the augmented matrix is equal to the rank of the coefficient matrix. Why? 41

42 Rank Because the only way for a system to have no solutions is for the augmented matrix in echelon form to have as its last nonzero row [0 … 0 c] with c ≠ 0. But now the rank of the augmented matrix is greater than the rank of the coefficient matrix. So if the ranks are equal, it means that this case cannot arise 42


Download ppt "Student Handbook 1. Matrices A matrix (plural: matrices, not matrixes) is a rectangular array of numbers such as Matrices are useful when modelling a."

Similar presentations


Ads by Google