Answer only 3.3 please. you need matlab for this. 3.31, Logistics: Route Planning Suppose we have a
Fantastic news! We've Found the answer you've been seeking!
Question:
Answer only 3.3 please. you need matlab for this.
Transcribed Image Text:
3.31, Logistics: Route Planning Suppose we have a business operating in six cities around the Pacific Rim: San Diego, San Francisco, Tokyo, Shanghai, Manila, and Honolulu. We are interested in counting the number of ways we can travel from one city to another with at most n stopovers. We look up all the direct flights and put them in a table: Destination San Diego San Francisco San Francisco San Diego, Tokyo, Shanghai, Manila, Honolulu Tokyo San Francisco, Shanghai, Manila Shanghai San Diego, San Francisco, Tokyo, Manila Manila Tokyo, Shanghai, Honolulu Honolulu San Francisco, Shanghai, Manila Let's say we want to get from San Diego to Manila with at most three stops along the way. For example, the trip going from San Diego through San Francisco, then Honolulu, then Shanghai, then Manila is a trip with exactly three stops.. Exercise 3.2 List all possible ways to get from San Diego to Manila with exactly three stops. Doing that last exercise by hand is a pain because there are so many cases to check, and this is a relatively simple example. If we want to do this efficiently, linear algebra is the perfect tool. We'll start by encoding the data from our table into what's called an adjacency matrix. The first step is to number our cities in the order they are listed: San Diego is 1, San Francisco is 2, and so on. We now determine the entries of our adjacency matrix, which we will call A, using the following rule: if there is a flight from city i to city, then the entry A, is set to 1. Otherwise, we set that entry to 0. We will also set all of the diagonal entries to 0. since you can't take a flight from a city to itself. This procedure gives us the following matrix A: 010000 101 111 010110 111010 001101 010110 What's neat about this is that the powers of A have useful information too. For example, take the entry (A) (ie, the entry of A in the third row and sixth column). We compute this as (A)6 AA+AA+AA+AA+AA + A6A6 Let's look at the terms here: AAs is 1 if and only if both A and As are 1. This means we get a 1 for the th term if and only if we can fly from Tokyo (city 3) to city k and from city k to Honolulu (city 6). Thus, (A) counts the number of ways to fly from Tokyo to Honolulu with exactly one stop. Similar reasoning shows that the number of ways of flying from city / to city with exactly n stops is just (A) Exercise 3.3 a. Enter the above adjacency matrix A into MATLAB. By looking at the entry of A in the first row and the fifth column, find the number of ways to get from San Diego to Manila with exactly three stops. Does your answer here agree with your explicit count in the previous exercise? If not, find the missing trips. Include your input and output in your document. b. Now use MATLAB find the number of ways to get from San Francisco to Tokyo with at most four stops. (This is not the same as finding the number of ways with exactly four stops!) Include all of your commands and output in your write-up. Note 3.1: As you may have realized, the method we've just used counts silly trips like San Francisco - Shanghai San Francisco - Shanghai as a trip with two stops. User beware! 3.31, Logistics: Route Planning Suppose we have a business operating in six cities around the Pacific Rim: San Diego, San Francisco, Tokyo, Shanghai, Manila, and Honolulu. We are interested in counting the number of ways we can travel from one city to another with at most n stopovers. We look up all the direct flights and put them in a table: Destination San Diego San Francisco San Francisco San Diego, Tokyo, Shanghai, Manila, Honolulu Tokyo San Francisco, Shanghai, Manila Shanghai San Diego, San Francisco, Tokyo, Manila Manila Tokyo, Shanghai, Honolulu Honolulu San Francisco, Shanghai, Manila Let's say we want to get from San Diego to Manila with at most three stops along the way. For example, the trip going from San Diego through San Francisco, then Honolulu, then Shanghai, then Manila is a trip with exactly three stops.. Exercise 3.2 List all possible ways to get from San Diego to Manila with exactly three stops. Doing that last exercise by hand is a pain because there are so many cases to check, and this is a relatively simple example. If we want to do this efficiently, linear algebra is the perfect tool. We'll start by encoding the data from our table into what's called an adjacency matrix. The first step is to number our cities in the order they are listed: San Diego is 1, San Francisco is 2, and so on. We now determine the entries of our adjacency matrix, which we will call A, using the following rule: if there is a flight from city i to city, then the entry A, is set to 1. Otherwise, we set that entry to 0. We will also set all of the diagonal entries to 0. since you can't take a flight from a city to itself. This procedure gives us the following matrix A: 010000 101 111 010110 111010 001101 010110 What's neat about this is that the powers of A have useful information too. For example, take the entry (A) (ie, the entry of A in the third row and sixth column). We compute this as (A)6 AA+AA+AA+AA+AA + A6A6 Let's look at the terms here: AAs is 1 if and only if both A and As are 1. This means we get a 1 for the th term if and only if we can fly from Tokyo (city 3) to city k and from city k to Honolulu (city 6). Thus, (A) counts the number of ways to fly from Tokyo to Honolulu with exactly one stop. Similar reasoning shows that the number of ways of flying from city / to city with exactly n stops is just (A) Exercise 3.3 a. Enter the above adjacency matrix A into MATLAB. By looking at the entry of A in the first row and the fifth column, find the number of ways to get from San Diego to Manila with exactly three stops. Does your answer here agree with your explicit count in the previous exercise? If not, find the missing trips. Include your input and output in your document. b. Now use MATLAB find the number of ways to get from San Francisco to Tokyo with at most four stops. (This is not the same as finding the number of ways with exactly four stops!) Include all of your commands and output in your write-up. Note 3.1: As you may have realized, the method we've just used counts silly trips like San Francisco - Shanghai San Francisco - Shanghai as a trip with two stops. User beware!
Expert Answer:
Answer rating: 100% (QA)
33 a Program code screen shot Sample Output Program code to copy define the Adjacency matrix as specified in the question that is each row is corresponds to the source city and each column specifies t... View the full answer
Related Book For
Understanding Basic Statistics
ISBN: 9781111827021
6th Edition
Authors: Charles Henry Brase, Corrinne Pellillo Brase
Posted Date:
Students also viewed these programming questions
-
Need MATLAB code for this. Please perform only on MATLAB. Attach the output also. R(s) C(s) G(s) H(s) Figure I1.1: Negative feedback system.
-
You have two choices for this written assignment; you only need to address one. Topic 1: The cost of healthcare has been a controversial subject for quite some time, both to businesses and employees....
-
You may need Table to answer the following questions. a. Which is the stronger acid, HCl or H2O? b. Which is the stronger acid, H2O or HNO2? c. Which is the stronger acid, HCN or HOC6H5? Table...
-
Incorporated in 1990, Raju Diary Ltd is one of the leading manufacturers and marketers of diary-based branded foods in India. In the initial years, its operations were restricted only to the...
-
During its most recent fiscal year, Bargain Airlines grounded 10 of its 747s due to a potential problem with the wing flaps. Although the planes had been repaired by the end of the fiscal year, the...
-
Perform the following matrix multiplications. (a) Matrix C = Matrix A x Matrix B (b) Matrix G = Matrix E x Matrix F (c) Matrix T = Matrix R x Matrix S (d) Matrix Z = Matrix W x MatrixY Matrix A...
-
Identify the most appropriate approach and then design. Provide a rationale as to why this approach and design would be most appropriate. Develop a hypothetical research scenario that would...
-
(Entries for Bond Transactions) On January 1, 2010, Osborn Company sold 12% bonds having a maturity value of $800,000 for $860,651.79, which provides the bondholders with a 10% yield. The bonds are...
-
The technical support call centre for a software company has a mean wait time of 210 s, with a standard deviation of 40 s. The management team wants to continue to improve customer satisfaction by...
-
The Philbrick Company has two plants on opposite sides of the United States. Each of these plants produces the same two products and then sells them to wholesalers within its half of the country. The...
-
Define the following terms: a. Substantive Law b. Procedural Law c. Public Law d. Private Law e. Civil Law f. Torts g. Criminal Law h. Common Law i. Constitutional Law j. Case Law k. Statutory Law
-
Savor the Sweet Bakery has been selling 550 boxes of cupcakes per month at a price of $19/box. When they raised their price to $21/box, they sold only 450 boxes. 1)What is the price elasticity of...
-
How does the immune system distinguish between self and non-self antigens, and what are the consequences of autoimmune diseases where this distinction breaks down?
-
In footnotes to its 2016 annual report, Bancfirst Corp. reported that held-to-maturity debt securities with an amortized cost of $4,365 thousand had an estimated fair value of $4,403 thousand. a....
-
Bobby has a real salary of $61,430. Julianne has a real salary of $124,875. Neither one contributes to a retirement plan. a. If Bobby & Julianne are married and take a standard deduction, how much...
-
On January 1, 2018, the Coldstone Corporation adopted the dollar-value LIFO retail inventory method. Beginning inventory at cost and at retail were $170,000 and $273,000, respectively. Net purchases...
-
Many public listed companies have been adversely affected by the global economic crisis triggered by China-U.S trade war plus the recent covid-19 pandemic. Evaluate the effectiveness of the current...
-
Don Griffin worked as an accountant at a local accounting firm for five years after graduating from university. Recently, he opened his own accounting practice, which he operates as a corporation....
-
Case studies showed that out of 10,351 convicts who escaped from U.S. prisons, only 7867 were recaptured (The Book of Odds by Shook and Shook, Signet). (a) Let p represent the proportion of all...
-
Look at the following diagrams. Does each diagram show high linear correlation, moderate or low linear correlation, or no linear correlation? (a) (b) (c)
-
Categorize these measurements associated with a robotics company according to level: nominal, ordinal, interval, or ratio. (a) Salespersons performance: below average, average, above average (b)...
-
Goods are products a business sells like a. haircuts. b. conveyer belts. c. car insurance. d. health care.
-
Which of the following are the factors of production? a. Labor, natural resources, capital, entrepreneurs, technology, and intellectual property b. Labor, capital, entrepreneurs, motivation, and good...
-
Which of the following is a current sociocultural trend? a. A decrease in the overall U.S. population b. An increase in the population of Americans ages 30 to 45 years old c. A decrease in the U.S....
Study smarter with the SolutionInn App