linear algebra a brush up course
play

Linear algebra A brush-up course Anders Ringgaard Kristensen 1 - PDF document

Advanced Herd Management Linear algebra A brush-up course Anders Ringgaard Kristensen 1 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Outline Real numbers Operations Linear equations Matrices and


  1. Advanced Herd Management Linear algebra A brush-up course Anders Ringgaard Kristensen 1 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Outline � Real numbers � Operations � Linear equations � Matrices and vectors � Systems of linear equations 2 1

  2. Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Let us start with something familiar! � Real numbers! � The real number system consists of 4 parts: � A set R of all real numbers � A relation < on R. If a, b ∈ R, then a < b is either true or false. It is called the order relation. � A function +: R × R → R . The addition operation � A function · : R × R → R . The multiplication operation. � A number of axioms apply to real numbers 3 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Axioms for real numbers I � Associative laws � a + ( b + c ) = ( a + b ) + c � a · ( b · c ) = ( a · b ) · c � Commutative laws � a + b = b + a � a · b = b · a � Distributive law � a · ( b + c ) = a · b + a · c 4 2

  3. Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Axioms for real numbers II � Additive identity (”zero” element) � There exist an element in R called 0 so that, for all a , a + 0 = a � Additive inverse For all a there exists a b so that a + b = 0, and b = − a � � Multiplicative identity (”one” element) � There exists an element in R called 1 so that, for all a , 1 · a = a � Multiplicative inverse For all a ≠ 0 there exists a b so that a · b = 1, and b = a -1 � 5 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Solving equations � Let a ≠ 0 and b be known real numbers, and x be an unknown real number. � If, for some reason, we know that a · x = b, we say that we have an equation. � We can solve the equation in a couple of stages using the axioms: a · x = b ⇔ a - 1 · a · x = a - 1 · b ⇔ 1 · x = a - 1 · b ⇔ x = a - 1 · b 6 3

  4. a · x = b ⇔ x = a - 1 · b Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Example of a trivial equation � Farmer Hansen has delivered 10000 kg milk to the dairy last week. He received a total payment of 23000 DKK. From this information, we can find the milk price per kg ( a = 10000, b = 23000, x = milk price): � 10000 · x = 23000 ⇔ � x = 10000 -1 · 23000 = 0.0001 · 23000 = 2.30 � So, the milk price is 2.30 DKK/kg 7 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH What is a matrix? � A matrix is a rectangular table of real numbers arranged in columns and rows. � The dimension of a matrix is written as n × m , where n is the number of rows, and m is the number of columns. � We may refer to a matrix using a single symbol, like a , b , x etc. Some times we use bold face ( a , b , x ) or underline ( a , b , x ) in order to emphasize that we refer to a matrix and not just a real number. 8 4

  5. Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Examples of matrices � A 2 × 3 matrix: � A 4 x 3 matrix: � Symbol notation for a 2 × 2 matrix: 9 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Special matrices � A matrix a of dimension n × n is called a quadratic matrix: � A matrix b of dimension 1 × n is called a row vector : � A matrix c of dimension n × 1 is called a column vector : 10 5

  6. Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Operations: Addition � Two matrices a and b may be added, if they are of same dimension (say n × m ): � From the axioms of real numbers, it follows directly that the commutative law is also valid for matrix addition: � a + b = b + a 11 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Additive identity? � Does the set of n × m matrices have a ”zero” element 0 so that for any a , a + 0 = a � If yes, what does it look like? 12 6

  7. Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Operations: Multiplication � Two matrices a and b may be multiplied, if a is of dimension n × m , and b is of dimension m × k � The result is a matrix of dimension n × k . � Due to the dimension requirements, it is clear that the commutative law is not valid for matrix multiplication. � Even when b · a exists, most often a · b ≠ b · a 13 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Vector multiplication � A row vector a of dimension 1 × n may be multiplied with a column vector b of dimension n × 1. The product a · b is a 1 × 1 matrix (i,e. a real number), where as the product b · a is a quadratic n × n matrix: 14 7

  8. Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Matrix multiplication revisited � A 3 × 3 matrix multiplied with a 3 × 2 matrix 5 4 An element in the product is 3 6 calculated as the product of a row and a column 1 2 21 30 2 3 2 15 24 1 2 4 22 26 3 2 1 15 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Multiplicative identity � Does the set of matrices have a ”one” element I 1 , so that if I 1 is an n × m matrix, then for any m × k matrix a, I 1 · a = a � If yes: � What must the value of n necessarily be? � What are the elements of I 1 – what does the matrix look like? � Does there exist a ”one” element I 2 so that for any matrix a of given dimension, a · I 2 = a � If yes: Same questions as before 16 8

  9. Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Additive inverse � It follows directly from the axioms for real numbers, that every matrix a , has an additive inverse, b , so that a + b = 0 , and, for the additive inverse, b = − a 17 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Other matrix operations � A real number r may be multiplied with a matrix a � The transpose a’ of a matrix a is formed by changing columns to rows and vice versa: 18 9

  10. Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Other matrix operations: Examples � If r = 2, and then: � The transpose a’ of a is 19 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Multiplicative inverse I Does every matrix a ≠ 0 have a multiplicative inverse, � b , so that a · b = I � If yes, � What does it look like? 20 10

  11. Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Multiplicative inverse II � A matrix a only has a multiplicative inverse under certain conditions: � The matrix a is quadratic (i.e. the dimension is n × n ) � The matrix a is non-singular : � A matrix a is singular if and only if det( a ) = 0, where det( a ) is the determinant of a � For a quadratic zero matrix 0, we have det(0) = 0, so 0 is singular (as expected) � Many other quadratic matrices are singular as well � 21 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Determinant � The determinant of a quadratic matrix is a real number. � Calculation of the determinant is rather complicated for large dimensions. � The determinant of a 2 × 2 matrix: � The determinant of a 3 × 3 matrix: 22 11

  12. Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH The (multiplicative) inverse matrix � If a quatratic matrix a is non-singular, it has an inverse a -1 , and: � a · a -1 = I � a -1 · a = I � The inverse is complicated to find for matrices of high dimension. � For real big matrices (millions of rows and columns) inversion is a challenge even to modern computers. � Inversion of matrices is crucial in many applications in herd management (and animal breeding) 23 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Inversion of ”small” matrices I � A 2 × 2 matrix a is inverted as � Example 24 12

  13. Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Inversion of ”small” matrices II � A 3 × 3 matrix a is inverted as � Example 25 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Why do we need matrices? � Because they enable us to express very complex relations in a very compact way. � Because the algebra and notation are powerful tools in mathematical proofs for correctness of methods and properties. � Because they enable us to solve large systems of linear equations. 26 13

  14. Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Complex relations I � Modelling of drinking patterns of weaned piglets. 27 Anders Ringgaard Kristensen, IPH Anders Ringgaard Kristensen, IPH Complex relations � Madsen et al. (2005) performed an on- line monitoring of the water intake of piglets. The water intake Y t at time t was expressed as � Where � Simple, but … 28 14

Recommend


More recommend