Lecture 3 Matrix algebra Species Taxon Guild Nanoptilium kunzei (Heer, 1841) Acrotrichis dispar (Matthews, 1865) Ptiliidae Ptiliidae Necrophagous Necrophagous Mean length (mm) 0.60 0.65 Acrotrichis silvatica Rosskothen, 1935 Ptiliidae Necrophagous Acrotrichis rugulosa Rosskothen, 1935 Ptiliidae Acrotrichis grandicollis (Mannerheim, 1844) Acrotrichis fratercula (Matthews, 1878) Ptiliidae Ptiliidae Site 1 Site 2 Site 3 Site 4 0 13 0 0 0 4 0 7 0.80 16 0 2 0 Necrophagous 0.90 0 0 1 0 Necrophagous 0.95 1 0 0 1 Necrophagous 1.00 0 1 0 0 1 0 0 0 13 0 0 8 3 0 5 23 0 5 0 2 5 0 4 0 0 5 6 0 6 9 2 0 0 1 0 0 Carcinops pumilio (Erichson, 1834) Histeridae Predator 2.15 Saprinus aeneus (Fabricius, 1775) Histeridae Histeridae Histeridae Staphylinidae Histeridae Histeridae Histeridae Predator Predator Predator Predator Predator Predator Predator 3.00 Gnathoncus nannetensis (Marseul, 1862) Margarinotus carbonarius (Hoffmann, 1803) Rugilus erichsonii (Fauvel, 1867) Margarinotus ventralis (Marseul, 1854) Saprinus planiusculus Motschulsky, 1849 Margarinotus merdarius (Hoffmann, 1803) 3.10 3.60 3.75 4.00 4.45 4.50 A vector can be interpreted as a file of data Handling biological data is most easily done with a matrix approach. An Excel worksheet is a matrix. A matrix is a collection of vectors and can be interpreted as a data base The red matrix contain three column vectors A general structure of databases a11 A a m1 a1 a2 V a3 a4 a1n a mn The first subscript denotes rows, the second columns. n and m define the dimension of a matrix. A has m rows and n columns. V a1 a 2 Row vector Column vector a11 a12 V a 21 a 22 a 31 a 32 a3 a 4 a13 a 23 a 33 a11 a12 V a 21 a 22 a 31 a 32 a13 a 23 a 33 Two matrices are equal if they have the same dimension and all corresponding values are identical. Some elementary types of matrices In biology and statistics are square matrices An,n of particular importance 1 3 A 5 4 2 3 4 4 5 6 6 7 8 3 2 1 The symmetric matrix is a matrix where An,m = A m,n. 1 2 A 3 4 Λ 3 2 3 4 4 5 6 5 7 8 6 8 1 Lower and upper triangular matrices 1 2 A 3 4 0 0 0 4 0 0 5 7 0 6 8 1 1 0 A 0 0 2 3 4 4 5 6 0 7 8 0 0 1 The diagonal matrix is a square and symmetrical. 1 0 A 0 0 0 0 0 1 4 0 0 0 A 0 0 7 0 0 0 0 1 is a matrix with one row and one column. It is a scalar (ordinary number). 0 0 0 1 0 0 0 1 0 0 0 1 Unit matrix I Matrix operations Addition and Subtraction 1 2 A 3 3 a11 b11 ... ... a1m b1m 2 3 2 4 0 2 8 1 5 14 4 ... ... ... ... 2 4 1 2 0 7 5 5 10 9 9 AB ... ... ... ... 5 7 6 9 1 0 0 1 9 14 9 a b ... ... a b 1 0 1 1 4 5 6 1 9 8 5 nm nm n1 n1 Addition and subtraction are only defined for matrices with identical dimensions S-product 1 2 A 3 3 2 2 5 1 3 1 4 2 7 3 0 3 b11 ... B ... b n1 2 2 5 1 3 1 4 2 7 3 0 3 2 2 5 1 ... ... b1m ... ... ... B ... ... ... ... ... bnm 3 3 4 6 7 9 0 9 6 6 15 3 9 1 12 2 3 3 21 0 3 2 2 5 1 3 3 1 4 32 7 33 0 33 32 32 35 3 1 A B B A 1B A AB BA A (B C) (A B) C A A (A B) A B A( ) A A 3 3 34 37 30 The inner or dot or scalar product Assume you have production data (in tons) of winter wheat (15 t), summer wheat (20 t), and barley (30 t). In the next year weather condition reduced the winter wheat production by 20%, the summer wheat production by 10% and the barley production by 30%. How many tons do you get the next year? (15*0.8 + 20* 0.9 + 30 * 0.7) t = 51 t. 0.8 P 15 20 30 0.9 15*0.8 20*0.9 30*0.7 51 0.7 A B a1 b1 n ... a n ... a i bi scalar b i 1 n The dot product is only defined for matrices, where the number of columns in the first matrix equals the number of rows in the second matrix. We add another year and ask how many cereals we get if the second year is good and gives 10 % more of winter wheat, 20 % more of summer wheat and 25 % more of barley. For both years we start counting with the original data and get a vector with one row that is the result of a two step process 0.8 1.1 P 15 20 30 0.9 1.2 15*0.8 20*0.9 30*0.7 15*1.1 20*1.2 30*1.25 51 78 0.7 1.25 a11 ... a1m b11 A B ... ... ... ... a ... a a nm m1 n1 A B B A m a1i bi1 ... ... b1k i 1 ... ... ... ... ... a mk m a ni bi1 ... i 1 (A B) C A (B C) A B C (A B) C A C B C A ij B jk Cik A ij B jk C kl Dlm ...Z yz Ciz a b 1i ik A B ... A1Bk i 1 1 1 ... ... ... ... m A B ... A B m 1 m k a ni bik i 1 m Transpose A’ ot AT 1 2 3 4 2 . 171828 1 8 9 3.14159 3.56 4 3 2 1 2 3 4 1 4 3 2 1 2 3 4 5 3 4 T 1 2.171828 3.141459 1 3.56 2 3 8 4 4 9 3 1 29 30 2 21 20 3 39 40 4 AB a11 T a11 ... ... a1n ... ... ... ... ... a ... ... ... a mn m1 a 1n 1 2 1 3 4 2 * 1 2 3 4 3 4 ( A B)T BT AT ... am1 ... ... ... ... ... amn 2 4 3 3 29 21 39 2 4 30 20 40 1 5 BT A T Matrix add in for Excel: www.digilander.libero.it/foxes/SoftwareDownload.htm Ground beetles on Mazurian lake islands (Mamry) Carabus problematicus Carabus auratus Photo Marek Ostrowski Species Pterostichus nigrita (Paykull) Platynus assimilis (Paykull) Amara brunea (Gyllenhal) Agonum lugens (Duftshmid) Loricera pilicornis (Fabricius) Pterostichus vernalis (Panzer) Amara plebeja (Gyllenhal) Badister unipustulatus Bonelli Lasoitrechus discus (Fabricius) Poecilus cupreus (Linnaeus) Amara aulica (Panzer) Anisodatylus binotatus (Fabricius) Bembidion articulatum (Panzer) Clivina collaris (Herbst) wros 0 0 1 1 0 1 0 0 0 0 0 wron 2 0 1 1 0 1 0 0 0 0 1 wil 61 1 0 2 1 21 0 0 0 0 0 ter 53 0 0 2 0 2 0 0 1 0 0 swi 0 0 19 0 0 0 1 4 0 0 0 sos 18 9 40 0 0 1 2 1 0 2 0 mil 39 0 0 0 3 7 0 0 1 0 0 lip 2 117 1 0 0 0 4 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 2 0 0 0 Species associations Species Pterostichus nigrita (Paykull) Platynus assimilis (Paykull) Amara brunea (Gyllenhal) Agonum lugens (Duftshmid) Loricera pilicornis (Fabricius) Pterostichus vernalis (Panzer) Amara plebeja (Gyllenhal) Badister unipustulatus Bonelli Lasoitrechus discus (Fabricius) Poecilus cupreus (Linnaeus) Amara aulica (Panzer) Anisodatylus binotatus (Fabricius) Bembidion articulatum (Panzer) Clivina collaris (Herbst) wros 0 0 1 1 0 1 0 0 0 0 0 0 0 0 wron 2 0 1 1 0 1 0 0 0 0 1 0 0 0 wil 61 1 0 2 1 21 0 0 0 0 0 0 0 0 ter 53 0 0 2 0 2 0 0 1 0 0 0 0 0 swi 0 0 19 0 0 0 1 4 0 0 0 0 0 0 sos 18 9 40 0 0 1 2 1 0 2 0 0 0 0 mil 39 0 0 0 3 7 0 0 1 0 0 2 1 2 lip 2 117 1 0 0 0 4 3 0 0 0 0 0 0 Panagaeus cruxmajor (Linnaeus) Poecilus versicolor (Sturm) Pterostichus gracilis Dejean) Stenolophus mixtus Pseudoophonus rufipes (De Geer) Harpalus latus (Linnaeus) Agonum duftshmidi Shmidt Harpalus solitaris Dejean 0 0 0 0 0 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 13 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 5 3 0 0 5 0 0 0 3 0 0 1 1 2 0 0 2 2 0 0 Species Pterostichus nigrita (Paykull) Platynus assimilis (Paykull) Amara brunea (Gyllenhal) Agonum lugens (Duftshmid) Loricera pilicornis (Fabricius) Pterostichus vernalis (Panzer) Amara plebeja (Gyllenhal) Badister unipustulatus Bonelli Lasoitrechus discus (Fabricius) Poecilus cupreus (Linnaeus) Amara aulica (Panzer) Anisodatylus binotatus (Fabricius) Bembidion articulatum (Panzer) Clivina collaris (Herbst) wros 0 0 1 1 0 1 0 0 0 0 0 0 0 0 wron 2 0 1 1 0 1 0 0 0 0 1 0 0 0 wil 61 1 0 2 1 21 0 0 0 0 0 0 0 0 ter 53 0 0 2 0 2 0 0 1 0 0 0 0 0 swi 0 0 19 0 0 0 1 4 0 0 0 0 0 0 sos 18 9 40 0 0 1 2 1 0 2 0 0 0 0 mil 39 0 0 0 3 7 0 0 1 0 0 2 1 2 lip 2 117 1 0 0 0 4 3 0 0 0 0 0 0 S wros wron wil ter swi sos mil lip Panagaeus cruxmajor (Linnaeus) 0 24 0 0 1 0 5 1 Poecilus versicolor (Sturm) 0 0 0 0 0 0 0 2 Pterostichus gracilis Dejean) 0 0 0 0 0 0 0 0 Stenolophus mixtus 0 0 0 1 0 0 0 0 Pseudoopho nus rufipes (De Geer) 0 0 13 0 0 5 3 2 Harpalus latus (Linnaeus) 0 0 0 0 0 3 0 2 Agonum duftshmidi Shmidt 0 0 1 0 0 0 0 0 Harpalus solitaris Dejean 0 0 0 0 1 0 1 0 Species Pterostichus nigrita (Paykull) Platynus assimilis (Paykull) Amara brunea (Gyllenhal) Agonum lugens (Duftshmid) Loricera pilicornis (Fabricius) Pterostichus vernalis (Panzer) Amara plebeja (Gyllenhal) Badister unipustulatus Bonelli Lasoitrechus discus (Fabricius) Poecilus cupreus (Linnaeus) Amara aulica (Panzer) Anisodatylus binotatus (Fabricius) Bembidion articulatum (Panzer) Clivina collaris (Herbst) Panagaeus cruxmajor (Linnaeus) 245 117 44 24 15 59 5 7 5 0 24 10 5 10 Poecilus versicolor (Sturm) 4 234 2 0 0 0 8 6 0 0 0 0 0 0 Pterostichus gracilis Dejean) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Stenolophus mixtus 53 0 0 2 0 2 0 0 1 0 0 0 0 0 Pseudoopho nus rufipes (De Geer) 1004 292 202 26 22 299 18 11 3 10 0 6 3 6 Harpalus latus (Linnaeus) 58 261 122 0 0 3 14 9 0 6 0 0 0 0 Agonum duftshmidi Shmidt 61 1 0 2 1 21 0 0 0 0 0 0 0 0 Harpalus solitaris Dejean 39 0 19 0 3 7 1 4 1 0 0 2 1 2 Assume you are studying a contagious disease. You identified as small group of 4 persons infected by the disease. These 4 persons contacted in a given time with another group of 5 persons. The latter 5 persons had contact with other persons, say with 6, and so on. How often did a person of group C indirectly contact with a person of group A? B C A B 1 2 3 4 5 1 2 3 4 1 0 0 0 1 1 1 0 1 1 1 0 1 0 0 0 2 0 1 0 0 2 We eliminate 0 0 0 1 1 3 A 1 0 0 1 3 group B and leave B the first and last 0 0 0 1 1 4 0 0 0 1 4 0 1 0 0 0 group. 0 1 0 0 5 5 0 1 0 0 0 6 No. 1 of group C C A indirectly 1 2 3 4 contacted with all 1 0 0 0 1 1 1 1 1 1 members of group 1 0 1 1 0 1 0 0 2 A. 0 1 0 0 0 0 1 0 0 0 0 0 1 1 3 No. 2 of group A 0 1 0 1 1 0 0 1 C BA indirectly 0 0 0 1 1 0 1 0 1 4 contacted with all 0 1 0 0 0 0 0 0 1 0 1 0 0 5 six persons of 0 1 0 0 0 1 0 0 0 group C. 0 1 0 0 6 Lecture 4 Solving simple stoichiometric equations a1FeS2 11O2 a2 Fe2O3 a3 SO2 a1 2a2 a1 2a2 0a3 0 2a1 a3 2a1 0a2 a3 0 22 3a2 2a3 0a1 3a2 2a3 22 The Gauß scheme A linear system of equations 1 2 0 a1 0 2 0 1 a 2 0 0 3 a 22 2 3 a1a2 2a2 0a3 0 2a1 0a2 a3 a3 0 0a1 3a2 2a1a3 22 Multiplicative elements. A non-linear system Matrix algebra deals essentially with linear linear systems. x a0 a1u1 a2u 2 a3u3 ... anu n Solving a linear system 1 2 0 a1 0 2 0 1 a 2 0 0 3 a 22 2 3 a1 0 1 2 0 a 2 0 / 2 0 1 a 22 0 3 2 3 The division through a vector or a matrix is not defined! a11 a12 b1 ; B A a a 21 22 b2 a11b1 a12b2 c1 C A B a b a b 21 1 22 2 c2 C c1 b1 a11 a12 / B c2 b2 a21 a22 c1 a11b1 a12b2 c2 a21b1 a22b2 2 equations and four unknowns For a non-singular square matrix the inverse is defined as A A 1 I A 1 A I A matrix is singular if it’s determinant is zero. a a A 11 12 a21 a22 a a Det A A 11 12 a11a22 a21a12 a21 a22 Det A: determinant of A Singular matrices are those where some rows or columns can be expressed by a linear combination of others. Such columns or rows do not contain additional information. They are redundant. 1 2 3 A 2 4 6 7 8 9 r2=2r1 1 2 3 A 4 5 6 6 9 12 r3=2r1+r2 A linear combination of vectors V k1V1 k2 V2 k3V3 ... kn Vn A matrix is singular if at least one of the parameters k is not zero. The inverse of a 2x2 matrix a A 11 a12 a21 a22 a22 1 A a11a22 a12a21 a12 Determinant 1 a21 a11 The inverse of a square matrix only exists if its determinant differs from zero. Singular matrices do not have an inverse The inverse of a diagonal matrix a11 0 ... 0 0 a22 ... 0 A ... ... ... ... 0 0 ... ann 1 0 ... 0 a11 1 0 ... 0 1 A a22 ... ... ... ... 1 0 0 ... ann (A•B)-1 = B-1 •A-1 ≠ A-1 •B-1 The Nine Chapters on the Mathematical Art. (1000BC-100AD). Systems of linear equations, Gaussian elimination The inverse can be unequivocally calculated by the Gauss-Jordan algorithm Solving a simple linear system 1 a1FeS2 11O2 a2 Fe2O3 a3 SO2 1 1 2 0 1 2 0 a1 a1 a1 1 2 0 0 2 0 1 2 0 1 a 2 I a 2 a 2 2 0 1 0 0 3 2 0 3 2 a3 a3 a3 0 3 2 22 4FeS2 11O2 2 Fe2O3 8SO2 The general solution of a linear system 1 0 ... 0 1 ... A 1A I Identity matrix I ... ... ... X A 1B 0 0 ... Only possible if A is not singular. IX XI X If A is singular the system has no solution. AX B A 1AX A 1B 3 x 2 y 4 z 10 3 x 3 y 8 z 12 9 x 0 .5 y 2 . 3 z 1 Systems with a unique solution The number of independent equations equals the number of unknowns. 2 4 3 3 8 3 9 0.5 2.3 1 0 0 ... 1 2 4 3 3 8 3 9 0.5 2.3 X: Not singular 10 x 0.3819 12 y 4.5627 1 z 0.0678 2 4 10 3 3 8 12 3 9 0.5 2.3 1 The augmented matrix Xaug is not singular and has the same rank as X. The rank of a matrix is minimum number of rows/columns of the largest non-singular submatrix 2x1 6x 2 5x 3 9x 4 10 2 2x1 5x 2 6x 3 7x 4 12 2 4x1 4x 2 7x 3 6x 4 14 4 5x1 3x 2 8x 3 5x 4 16 5 6 5 4 3 5 6 7 8 9 x1 7 x2 6 x3 5 x4 10 12 14 16 2x1 3x 2 4x 3 5x 4 10 2 3 4 5 x1 Infinite number of solutions 4x1 6x 2 8x 3 10x 4 20 4 6 8 10 x2 4x1 5x 2 6x 3 7x 4 14 4 5 6 7 x3 8 5x1 6x 2 7x 3 8x 4 16 x4 5 6 7 10 20 14 16 2x1 3x 2 4x 3 5x 4 10 2 3 No solution 4x1 6x 2 8x 3 10x 4 12 4 6 4x1 5x 2 6x 3 7x 4 14 4 5 5x1 6x 2 7x 3 8x 4 16 5 6 10 12 14 16 4 8 6 7 5 x1 10 x 2 7 x3 8 x4 x1 3 6 9 10 x2 5 6 12 of4 solutions x3 14 5 4 7 x 4 2x1 3x 2 4x 3 5x 4 10 2 3 4 5 10 x1 4x1 6x 2 8x 3 10x 4 12 12 4 6 8 10 x2 4x1 5x 2 6x 3 7x 4 14 14 5 6 7 4 x 3 5 16 6 7 8 5x1 6x 2 7x 3 8x 4 16 x4 16 10x1 12x 2 14x 3 16x 4 No 16solution 10 12 14 16 2x1 3x 2 6x 3 9x 4 10 2 2x1 4x 2 5x 3Infinite 6x 4 number 12 2 4x1 5x 2 4x 3 7x 4 14 4 2x1 3x 2 4x 3 5x 4 10 2 3 4 5 x1 4x1 6x 2 8 x 3 10x 4 12 4 6 8 10 x 2 4x1 5x 2 6x 3 7x 4 14 5 6 7 4 x3 5 6 7 8 5x1 6x 2 7x 3 8x 4 16 Infinite number of solutions 10 x4 12 14 16 10x1 12x 2 14x 3 16x 4 32 10 12 14 16 32 Consistent Rank(A) = rank(A:B) = n Consistent Rank(A) = rank(A:B) < n Inconsistent Rank(A) < rank(A:B) Consistent Rank(A) = rank(A:B) < n Inconsistent Rank(A) < rank(A:B) Consistent Rank(A) = rank(A:B) = n The transition matrix Assume a gene with four different alleles. Each allele can mutate into anther allele. The mutation probabilities can be measured. A→A B→A C→A D→A A→A 0.997 0.001 0.001 0.001 A→B 0.001 0.994 0.001 0.004 A→C 0.001 0.003 0.995 0.004 A→D 0.001 0.002 0.003 0.991 Sum 1 1 1 Initial allele frequencies 0 .4 0 .2 0.3 0.1 1 What are the frequencies in the next generation? Transition matrix Probability matrix A(t 1) 0.4 * 0.997 0.2 * 0.001 0.3 * 0.001 0.1* 0.001 0.3994 B(t 1) 0.4 * 0.001 0.2 * 0.994 0.3 * 0.001 0.1* 0.004 0.1999 C (t 1) 0.4 * 0.001 0.2 * 0.003 0.3 * 0.995 0.1* 0.004 0.2999 D(t 1) 0.4 * 0.001 0.2 * 0.002 0.3 * 0.003 0.1* 0.991 0.1008 A(t 1) 0.997 B(t 1) 0.001 C (t 1) 0.001 D(t 1) 0.001 0.001 0.001 0.001 A(t ) 0.994 0.001 0.004 B(t ) 0.003 0.995 0.004 C (t ) 0.002 0.003 0.991 D(t ) F (t 1) PF (t ) Σ=1 The frequencies at time t+1 do only depent on the frequencies at time t but not on earlier ones. Markov process Does the mutation process result in stable allele frequencies? A(t 1) A(t ) 0.997 B(t 1) B(t ) 0.001 C (t 1) C (t ) 0.001 D(t 1) D(t ) 0.001 AN N AN N 0 ( A I ) N 0 0.001 0.001 0.001 A(t ) 0.994 0.001 0.004 B(t ) 0.003 0.995 0.004 C (t ) 0.002 0.003 0.991 D(t ) AN N Stable state vector Eigenvector of A Eigenvalue Unit matrix Eigenvector A B C D A B C D 0.997 0.001 0.001 0.001 0.001 0.994 0.001 0.004 0.001 0.003 0.995 0.004 0.001 0.002 0.003 0.991 Eigenvectors 0 0 0.842927 0.48866 0.555069 0.780106 -0.18732 0.43811 0.241044 -0.5988 -0.46829 0.65716 -0.79611 -0.1813 -0.18732 0.3707 Eigenvalues 0.988697 0.992303 0.996 1 Every probability matrix has at least one eigenvalue = 1. The largest eigenvalue defines the stable state vector The insulin – glycogen system At high blood glucose levels insulin stimulates glycogen synthesis and inhibits glycogen breakdown. N fN g The change in glycogen concentration N can be modelled by the sum of constant production g and concentration dependent breakdown fN. At equilibrium we have fN g N 0 f N 1 g 0 1 D 2 N 2 N 1 The symmetric and square matrix D that contains squared values is called the dispersion matrix f T N 1T 0 0 1 N 1 g 1 N 2 f 2 0 N g 1 The vector {-f,g} is the stationary state vector (the largest eigenvector) of the dispersion matrix and gives the equilibrium conditions (stationary point). 0 2 N The glycogen concentration at equilibrium: N N 2 1 0 f 1 0 0 0 1 g The value -1 is the eigenvalue of this system. N equi g f The equilbrium concentration does not depend on the initial concentrations A matrix with n columns has n eigenvalues and n eigenvectors. Some properties of eigenvectors If is the diagonal matrix of eigenvalues: The eigenvectors of symmetric matrices are orthogonal ΛU UΛ A( symmetric) : U' U 0 AU UΛ AUU 1 A UU 1 Eigenvectors do not change after a matrix is multiplied by a scalar k. Eigenvalues are also multiplied by k. The product of all eigenvalues equals the determinant of a matrix. [ A I ]u [kA kI ]u 0 det A i 1 i n The determinant is zero if at least one of the eigenvalues is zero. In this case the matrix is singular. If A is trianagular or diagonal the eigenvalues of A are the diagonal entries of A. A 2 3 3 -1 2 4 3 -6 -5 5 Eigenvalues 2 3 4 5 Page Rank Google sorts internet pages according to a ranking of websites based on the probablitites to be directled to this page. Assume a surfer clicks with probability d to a certain website A. Having N sites in the world (30 to 50 bilion) the probability to reach A is d/N. Assume further we have four site A, B, C, D, with links to A. Assume further the four sites have cA, cB, cC, and cD links and kA, kB, kC, and kD links to A. If the probability to be on one of these sites is pA, pB, pC, and pD, the probability to reach A from any of the sites is therefore dk dk dk p A pB B A cB pC CA cC pD D A cD p A pB dk B A dk dk pC C A pD D A cB cC cD The total probability to reach A is pA dk dk dk d pB B A pC C A pD D A N cB cC cD Google uses a fixed value of d=0.15. Needed is the number of links per website. 1 dk A B / c A dk AC / c A dk A D / c A Probability matrix P pA dk d dk dk pB B pC C pD D N cB cC cD pB dk d dk dk p A A pC C pD D N cA cC cD pC d dk dk dk p A A pB B pD D N cA cB cD pD dk d dk dk p A A pB B pC C N cA cB cC dk B A / cB 1 dkC A / cC dkC B / cC dk B / cBC dk B D / cB 1 dkC D / cC dk D A / cD p A d dk D B / cD pB 1 d dk DC / cD pC N d d 1 pD Rank vector u Internet pages are ranked according to probability to be reached A B C D 0 0 0 p A 1 0.15 p 0 . 15 1 0 . 15 0 . 075 0 . 15 B 1 0 0.15 1 0.075 pC 4 0.15 0 0 0 1 pD 0.15 P A B C D 1 -0.15 0 0 0 1 -0.15 0 0 -0.15 1 0 0 -0.075 -0.075 1 0.0375 0.0375 0.0375 0.0375 1 0 0 0 0.153453 1.023018 0.153453 0.088235 0.023018 0.153453 1.023018 0.088235 0 0 0 1 A 0.0375 B 0.053181 C 0.04829 D 0.0375 P-1 Larry Page (1973- Sergej Brin (1973- Page Rank as an eigenvector problem 0 0 0 p A 1 0.15 1 0.15 0.075 pB 1 0.15 0.15 0 0.15 1 0.075 pC 4 0.15 0 p 0.15 0 0 1 D In reality the constant is very small 0 0 0 p A 1 1 0.15 0.075 pB 0.15 0 0 0.15 1 0.075 pC 0 p 0 0 1 D 0 0 0 0 1 0 . 15 0 0 . 15 0 . 075 0 0 0.15 0 0.075 0 0 0 0 0 0 A B C D 0 0 0 p A 1 0 0 p B 0 0 1 0 pC 0 0 1 pD A B C D 0 0 0 0 -0.15 0 -0.15 -0.075 0 -0.15 0 -0.075 0 0 0 0 Eigenvectors 0 0.707107 0.408248 0 0.707107 0 0.408248 0.70711 0.707107 -0.70711 0 -0.7071 0 0 -0.8165 0 The final page rank is given by the stationary state vector (the vector of the largest eigenvalue). Eigenvalues -0.15 0 0 0.15 0 0 0 0 Home work and literature Refresh: Literature: • • • • • • • • Mathe-online Stoichiometric equations: http://sciencesoft.at/equation/index?l ang=en Stoichiometry: http://en.wikipedia.org/wiki/Stoichio metry Vectors Vector operations (sum, S-product, scalar product) Scalar product of orthogonal vectors Distance metrics (Euclidean, Manhattan, Minkowski) Cartesian system, orthogonal vectors Matrix Types of matrices Basic matrix operations (sum, S-product, dot product) Prepare to the next lecture: • Linear equations • Inverse • Stochiometric equations