* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download In any dominance-directed graph there is at least one vertex from
Survey
Document related concepts
Linear least squares (mathematics) wikipedia , lookup
Rotation matrix wikipedia , lookup
System of linear equations wikipedia , lookup
Eigenvalues and eigenvectors wikipedia , lookup
Jordan normal form wikipedia , lookup
Determinant wikipedia , lookup
Four-vector wikipedia , lookup
Matrix (mathematics) wikipedia , lookup
Singular-value decomposition wikipedia , lookup
Non-negative matrix factorization wikipedia , lookup
Orthogonal matrix wikipedia , lookup
Perron–Frobenius theorem wikipedia , lookup
Matrix calculus wikipedia , lookup
Cayley–Hamilton theorem wikipedia , lookup
Transcript
Chapter III Applications of Linear Algebra While linear algebra has its elegant abstract side, it also has many real-life applications. These range from looking at traffic flow through downtown to predicting the weather. The following pages represent an attempt to stimulate the interest in Linear Algebra by selecting a wide variety of problems that arise in different topics of that discipline. Applications to business Problems Example 3.1: A cosmetic company manufactures the following products: hair spray, tooth paste and deodorant. The following table indicates the number of boxes of each product ordered by four different supermarkets: Hair spray Tooth paste Deodorant Supermarket I 5 4 7 Supermarket II 8 0 1 Supermarket III 13 3 9 Supermarket IV 2 6 3 The hair spray costs 12 SR, the toothpaste costs 9 SR and the deodorant costs 15SR per box. 5 12 8 We can get the income of each matrix by letting C 9 and A 13 15 2 4 7 0 1 . 3 9 6 3 201 111 Multiplying, we get AC , where each row is the total income from each 318 123 supermarket. We can also get the total income from the four supermarkets by adding The total income =201+111+318+123=753 SR 1 Example 3.2: Three salesmen for a dress manufacturer submit the following orders for a certain model specifying the colors and sizes they want as follows: Salesman I ordered: Black Red Size 8 12 10 Size 10 8 2 Size 12 7 0 Size 14 5 4 Green 5 8 17 19 Beige 1 5 9 0 Salesman II ordered: Black Red Size 8 2 3 Size 10 5 0 Size 12 3 14 Size 14 10 7 Green 4 9 17 3 Beige 1 6 8 2 Salesman III ordered: Black Red Size 8 0 4 Size 10 5 4 Size 12 8 7 Size 14 0 1 Green 8 3 12 5 Beige 12 9 6 0 We can obtain a lot of information from these matrices, for instance: The number of size-12 dresses sold is 108 dresses The number of beige dresses sold is 59 dresses The number of black dresses sold is 65 dresses The number of dresses sold by salesman III is 84 dresses And so on…... Application to Cryptography Cryptography is concerned with keeping communications private. Indeed, the protection of sensitive communications has been the emphasis of cryptography throughout much of its history. Encryption is the transformation of data into some unreadable form. Its purpose is to ensure privacy by keeping the information hidden from anyone for whom it is not intended. Decryption is the reverse of encryption; it is the transformation of encrypted data back into some intelligible form. 2 Example3.3: Let the message be PREPARE TO NEGOTIATE and the encoding matrix be 3 3 4 0 1 1 4 3 4 We assign a number for each letter of the alphabet. For simplicity, let us associate each letter with its position in the alphabet: A is 1, B is 2, and so on. Also, we assign the number 27 (remember we have only 26 letters in the alphabet) to a space between two words. Thus the message becomes: P R 16 18 E P 5 16 A R E * T O * N 1 18 5 27 20 15 27 14 E G 5 O T I A 7 15 20 9 1 T E 20 5 Since we are using a 3 by 3 matrix, we break the enumerated message above into a sequence of 3 by 1 vectors: 16 18 5 16 1 18 5 27 20 15 27 14 5 7 15 20 9 1 20 5 27 Note that it was necessary to add a space at the end of the message to complete the last vector. We now encode the message by multiplying each of the above vectors by the encoding matrix. This can be done by writing the above vectors as columns of a matrix and perform the matrix multiplication of that matrix with the encoding matrix as follows: 3 3 4 16 16 5 15 5 20 20 0 1 1 18 1 27 27 7 9 5 4 3 4 5 18 20 14 15 1 27 which gives the matrix 122 123 176 182 96 91 183 23 19 47 41 22 10 32 138 139 181 197 101 111 203 3 The columns of this matrix give the encoded message. The message is transmitted in the following linear form 122, 23, 138, 123, 19, 139, 176, 47, 181, 182, 41, 197, 183 32 96, 91, 22, 101, 10, 111, 203. To decode the message, the receiver writes this string as a sequence of 3 by 1 column matrices and repeats the technique using the inverse of the encoding matrix. The inverse of this encoding matrix, the decoding matrix, is: 0 1 1 4 4 3 4 3 3 Thus, to decode the message, perform the matrix multiplication 122 123 176 182 96 91 183 23 19 47 41 22 10 32 138 139 181 197 101 111 203 0 1 1 4 4 3 4 3 3 and get the matrix 16 16 5 15 5 20 20 18 1 27 27 7 9 5 5 18 20 14 15 1 27 The columns of this matrix, written in linear form, give the original message: 16 18 5 16 1 18 5 27 20 15 27 14 5 P E A E * E G R P R T O * 4 N 7 15 20 9 1 O T I A 20 5 T E Application to Graph theory Introduction and a little bit of History: Königsberg was a city in Russia situated on the Pregel River, which served as the residence of the dukes of Prussia in the 16th century. Today, the city is named Kaliningrad, and is a major industrial and commercial centre of western Russia. The river Pregel flowed through the town, dividing it into four regions, as in the following picture. In the eighteenth century, seven bridges connected the four regions. Königsberg people used to take long walks through town on Sundays. They wondered whether it was possible to start at one location in the town, travel across all the bridges without crossing any bridge twice and return to the starting point. This problem was first solved by the prolific Swiss mathematician Leonhard Euler, who, as a consequence of his solution invented the branch of mathematics now known as graph theory. Euler’s solution consisted of representing the problem by a “graph” with the four regions represented by four vertices and the seven bridges by seven edges as follows: 5 Graph Theory is now a major tool in mathematical research, electrical engineering, computer programming and networking, business administration, sociology, economics, marketing, and communications; the list can go on and on. Basic concepts of graph theory Before we make the connection between graph theory and linear algebra, we start with some basic definitions in graph theory: A graph is a collection of points called vertices, joined by lines called edges: A graph is called directed or a digraph if its edges are directed (that means they have a specific direction). A path joining two vertices X and Y of a digraph is a sequence of distinct points (vertices) and directed edges. A path starting and ending at one vertex P is called a loop at P. For example, in the digraph: 6 there is more than one path from P1 to P3. One of them consists of three points P1 P2 P3. A different path from P1 to P3 consists of the points P1 P2 P4 P5 P3. A graph is called connected if there is a path connecting any two distinct vertices. It is called disconnected otherwise: In a graph G, if there exists a path consisting of n edges between two vertices Pi and Pj, then we say that there exists an n-walks from Pi to Pj. For instance, there are three different 2-walks between the points P2 and P7 on the above graph G1. So how is linear Algebra related to graph theory? As you can expect, graphs can be sometimes very complicated. So one needs to find more practical ways to represent them. Matrices are a very useful way of studying graphs, since they turn the picture into numbers, and then one can use techniques from linear algebra. Given a graph G with n vertices v1,…,vn, we define the adjacency matrix of G with respect to the enumeration v1,…,vn of the vertices as being the n×n matrix A=[aij] defined by 7 aij 1 if there is an edge from vi to v j otherwise 0 For example, for the graph G1 above, the adjacency matrix is 0 1 0 M 1 0 1 0 1 1 0 0 1 0 1 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 1 0 0 0 1 1 0 1 1 1 1 0 1 0 Note that for an undirected graph, like G1, the adjacency matrix is symmetric (that is it is equal to its transpose), but it is not necessarily the case for a digraph like G2. The following theorem gives one important use of powers of the adjacency matrix of a graph: If A is the adjacency matrix of a graph G (with vertices v1,…, vn), the (i, j)-entry of Ar represents the number of distinct r-walks from vertex vi to vertex vj in the graph. Taking the square the matrix M1 above gives M1 2 3 1 2 2 0 2 1 1 2 2 0 2 1 4 1 1 1 2 3 1 2 2 0 1 1 1 2 3 1 1 2 1 0 1 2 0 2 2 1 1 0 3 1 3 1 2 2 1 5 The resulting matrix gives us the number of different paths using two edges between the vertices of the graph G1. For instance, there are three different 2-walks between the points P2 and P7 on the above graph; but there is no way to get from P 1 to P5 in two steps. 8 Example3.4: The following diagram represents the route map of a delivery company: where A, B, C, D, E are the cities served by the company. The adjacency matrix M of the above graph is: A B C D E A 0 0 1 1 0 B C D E 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 0 1 1 0 0 A 2 1 0 0 1 B C D E 1 0 1 1 1 0 0 0 2 2 1 0 1 1 2 0 0 0 1 1 A 1 0 3 3 1 B C D E 4 3 3 0 1 1 2 0 1 0 2 2 2 0 1 1 3 2 1 0 so M2 is the matrix: A B C D E and M3 is the matrix: A B C D E 9 If the company is mostly interested in connections from city A to city B, one can see that the number of 1-step connections between A and B is 1; the number of 2-step connections is 1, but the number of 3-step connections between the two cities is 4. These 4 connections can be given explicitly: 1. 1. A→C→E→B 2. 2. A→B→D→B 3. 3. A→D→A→B 4. 4. A→C→A→B Dominance -directed graph A digraph G is called a dominance-directed graph if for any pair of distinct vertices u and v of G, either u→v or v→u, but not both (here the notation u→v means there is an edge from u to v) The following is an example of a dominance-directed graph: In the above graph, the vertices A, C and E have the following property: from each one there is either a 1-step or a 2-step connection to any other vertex in the graph. In a sports tournament these vertices would correspond to the most powerful teams in the sense that these teams beat any given team or beat some other team that beat the given team. The above graph is not unique with this property. The following theorem guarantees that: 10 In any dominance-directed graph there is at least one vertex from which there is a 1step or a 2-step connection to any other vertex in the graph. In a dominance-directed graph, we define the power of a vertex, as being the total number of 1-step and 2-step connections to other vertices. Using the adjacency matrix M of the graph, one can find the power of a vertex Pi as follows: the sum of the entries in the ith row of M is the total number of 1-step connections from Pi to other vertices, and the sum of the entries in the ith row of M2 is the total number of 2-step connections from Pi to other vertices. Therefore, the sum of the entries in the ith row of the matrix A=M+ M2 is the total number of 1-step and 2-step connections from Pi to other vertices. In a dominance-directed graph, one would like to locate the vertices with the largest power. To do that, we compute the matrix A=M+ M2 , and then a row of A with the largest sum of entries corresponds to such a vertex. Example 3.5: Suppose that the results of a baseball tournament of five teams A, B, C, D and E are given by the dominance-directed graph H above. The adjacency matrix M of H is: 0 0 M 0 0 1 1 1 1 0 0 0 1 1 1 0 1 1 0 0 0 0 0 0 1 0 so, the matrix M2 is 11 0 1 M 2 1 0 0 1 0 2 2 0 0 1 0 0 0 2 1 0 0 0 0 1 1 1 0 and the matrix A=M+M2 is 0 1 M M 2 1 0 1 2 1 3 2 sum 8 0 0 2 1 sum 4 1 0 3 2 sum 7 0 0 0 0 sum 0 1 1 2 0 sum 5 Since the first row has the largest sum, the vertex A must have a 1-step or 2-step connection to any other vertex. The ranking of the teams according to the powers of the corresponding vertices is: Team A (first), Team C (second), Teams B and D (third) and Team E (last). Application of graph theory to sociology Sociologists interested in various kinds of communications in a group of individuals often use graphs to represent and analyze relations inside the group. The idea is to associate a vertex to each individual in the group, and if individual A influences or 12 dominates individual B, we draw a directed edge from A to B. Note that the obtained graph can have at most one directed edge between two distinct vertices. Example3.6: Consider a group of eight individuals I1,…, I8. The following digraph represents the dominance relationship among the individuals of the group: The adjacency matrix of this graph is: M I I2 I1 1 0 1 I2 0 0 I3 1 0 I4 0 0 I5 0 0 I6 0 1 I7 0 0 I8 0 0 I3 0 I4 1 I5 0 I6 0 I7 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 0 0 0 0 0 1 0 I8 0 0 0 0 1 0 1 0 The row with most 1’s in the above matrix corresponds to the most influential individual in the group; in our case it is I6. In the above graph, walks of length 1 (one edge) correspond to direct influence in the group, whereas walks of greater length correspond to indirect influence. For instance I3 directly influences I5 and I5 directly influences I4, therefore I3 indirectly influences I4. Now, squaring M gives M2 I I2 I1 1 0 0 I2 1 0 I3 0 1 I4 0 0 I5 0 0 I6 1 0 I7 0 0 I8 0 1 I3 1 I4 0 I5 0 I6 0 I7 0 0 0 1 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 1 0 1 1 0 0 1 13 I8 0 0 1 0 0 1 0 0 One can see that individual I8 has 2-stage influence on half of the group, although he has only one direct influence on I6. Which individual has the most influence on the other individuals? Applications to Computer Graphic This topic will be taught from section 11.11 the following text book: Elementary Linear Algebra (Application Version) By: Howard Anton and Chris Rorres 14