DOC PREVIEW
Pitt MATH 0280 - Exploration Assignment

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Math 0280 Introduction to Matrices and Linear AlgebraExploration Assignment #2(Matrix Operations)Acknowledgment The MATLAB assignments fot Math 0280 were developed by JonathanRubin with the help of Matthew BadgerSCHEDULE: The exploration assignment is due within two weeks. One submission pergroup (no more than three people) is sufficient. Every member of the group assumes fullresponsibility for the final product and should be prepared to answer any questions relatedto the work submitted.PLAN: In the second exploration, we consider two applications of matrix multiplication.After reviewing how to carry out matrix multiplication and finding inverses in MATLAB,we discuss 1) Markov chains and 2) graphs.MATLAB CONCEPTS: Suppose that we are given two matrices A and B such thatA =1 2 −34 5 67 8 9and B =1 23 45 6.To multiply A and B in MATLAB, typePROMPT>> A=[1,2,-3;4,5,6;,7,8,9]; <enter>PROMPT>> B=[1,2;3,4;5,6]; <enter>PROMPT>> A*B <enter>to output the product ABans =-8 -849 6476 100To find the power Akof a square matrix A, type either A*A*· · · *A| {z }k timesor A^k. For example,PROMPT>> A^3 <enter>gives the value of A3ans =-186 -228 -198894 1113 9361362 1698 1422To find the inverse A−1of a square matrix A, type either inv(A) or A^-1. For example,PROMPT>> inv(A) <enter>displays the inverse A−112ans =-0.1667 -2.3333 1.50000.3333 1.6667 -1.0000-0.1667 0.3333 -0.1667MARKOV CHAINS: (See pp. 228–233 in the text) Markov chains model the process ofmaking decisions according to a finite set of probabilities. Let’s illustrate with an example.Suppose that the same 600 people eat out every Friday at either Restaurant 1 (Mexican),Restaurant 2 (Chinese), or Restaurant 3 (Italian).The diagram represents the probability that a person will eat at Restaurant x, if he ate atRestaurant y the week before. For example, if a person ate Italian the previous week, thenthe next Friday he is 10% likely to eat Italian, 40% to eat Mexican, and 50% to eat Chinese.As a matrix T , called the transition matrix of the Markov chain, the diagram becomesT =0.3 0.3 0.40.3 0.2 0.50.4 0.5 0.1to 1to 2to 3from 1 2 3where the (i, j)–entry of T represents the probability that eating at restaurant j last week, aperson will eat at restaurant i next Friday (i.e., the probability of going from j to i). Observethat the each column of T sums to 1; by definition, this occurs in any Markov chain.Suppose that one week 100 people eat Mexican, 200 people eat Chinese, and 300 people eatItalian, say ~x1= [100, 200, 300]T. What happens the following week? Using T , we calculate~x2= T ~x1=0.3 0.3 0.40.3 0.2 0.50.4 0.5 0.1102030=210220170that 210 people eat Mexican, 220 eat Chinese, and 170 eat Italian. How many people eat ateach weekend the following week? Again, we use T and calculate~x3= T ~x2= T (T ~x1) = T2~x1=0.3 0.3 0.40.3 0.2 0.50.4 0.5 0.12102030=1971922113that 197 people eat Mexican, 192 people eat Chinese, and 211 people eat Italian. Inductively,if we repeat this process, the sequence ~x1, T ~x1, T2~x1, T3~x1, . . . forms a Markov chain.GRAPHS: (See pp. 235–239 in the text) By definition, a graph G = (V, E) is an object witha set of vertices V (points) connected by a set of edges E (lines). Let’s look at an example.The diagram above represents a graph with 4 vertices {1, 2, 3, 4} and 4 edges {13, 23, 24, 34}.Given a graph G with n vertices, we define its adjacency matrix to be the n×n matrix whose(i, j)–entry equals 1, if ij is an edge in the graph, equals 0, otherwise. For our example above,A =0 0 1 00 0 1 11 1 0 10 1 1 0is the corresponding adjacency matrix. Observe that A is a symmetric matrix (i.e., A = AT).In fact, the adjacency matrix of any graph is symmetric, because if there is an edge betweenvertices i and j, then there is also (in fact, the same) edge between j and i.Let’s consider motion in the graph. Informally, we think about “walking” along edges ofa graph to form a “path” between two points. More exactly, we define a path between twovertices i and j to be a sequence of edgesiv2, v2v3, v3v4, · · · , vk−1vk, vkjin the graph, where v2, · · · , vkare arbitrary vertices; the length of the path is the number ofterms in the sequence. In our running example, there are two paths between 1 and 4. First,13, 34 is a path of length 2. Second, 13, 32, 24 is a path of length 3.To find all the paths of length 2 in a graph, we consider the square of its adjacency matrix.In the running example, for instance,A2=1 1 0 11 2 1 10 1 3 11 1 1 2.Now, the (i, j)–entry of A2is exactly the number of length 2 paths between i and j. (STOP!Make sure that you check this yourself!) To find the number of length 2 paths in our graph,then, it suffices to add the entries on and above the main diagonal of A2. In this case here,there are exactly 13 paths of length 2.In general, the (i, j)–entry of Akis exactly the number of length k paths between i and j.4ASSIGNMENT: (OUT OF 40 POINTS) Complete all three parts and submit “explore2.m”.For each question, please provide any MATLAB commands that you use for computation.I. Exercise (8 Points)Let A, B, C and D be the following matrices:A =4 2 1 81 3 5 7−9 9 5 42 3 8 9, B =2 00 0, C =1 72 63 54 4, D =1 2 3 47 6 5 4(a) Which of the following sixteen products exist?: A ∗ A, A ∗ B, A ∗ C, A ∗ D, B ∗ A,B ∗ B, B ∗ C, B ∗ D, C ∗ A, C ∗ B, C ∗ C, C ∗ D, D ∗ A, D ∗ B, D ∗ C, and D ∗ D.(b) Pick a product from part (a) that exists. Find its value.(c) Pick a product from part (a) that does not exist. Why does it not exist?(d) Find the inverse for each of A, B, C and D, or explain why it does not exist.II. Markov Chains — United States Census (16 POINTS)The U.S. Census Bureau divides the United States into four geographical distinct regions:the Northeast, the Midwest, the South, and the West. According to the 2000 census, in theyear between 1999 and 2000, people moved between the regions as follows:People Moving From −→People Moving To ↓Northeast Midwest South WestNortheast 98.85% 0.11% 0.18% 0.17%Midwest 0.15% 99.01% 0.42% 0.35%South 0.76% 0.57% 98.97% 0.78%West 0.24% 0.32% 0.43% 98.70%2000 Population(in thousands)53594 64393 100237 63198(a) Find the transition matrix for the population movement between regions above.(b)


View Full Document

Pitt MATH 0280 - Exploration Assignment

Documents in this Course
Load more
Download Exploration Assignment
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Exploration Assignment and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Exploration Assignment 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?