Problem 6. Professor I. M. Nuts of the Math Department is scratching his head over the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem 6. Professor I. M. Nuts of the Math Department is scratching his head over the following problem. Given two sequences of numbers X (x1,...,xn) and Y = (y₁,..., yn) he must find the m≤ √n largest values of the sums xi + Yj, 1 ≤ i, j≤n in SORTED ORDER (smallest to largest). One may assume that m≤ √√n but one must not assume that m is a constant. The proposed algorithm should have worst-case running time that is o(n²). He requests the assistance of the CS Department in dealing with this problem. (a) Give an algorithm whose worst-case running time is o(n²) that solves this problem; an (n²2) time algorithm will not get you any points. (b) Does there exist an algorithm whose worst-case performance is O(n) ? Explain, i.e. show/prove that such an algorithm does not exist or give the algorithm and analyze its performance, if such an algorithm exists. Example. If X = (2,0, -2, -3, 1, 100, 290, 300, 4) and Y (-20, -19,-8, -200, 11, 1, 10, -7,0) and m = 3 then the answer is (301, 310, 311). Note that 301 can result either as the sum of 290 + 11 or 300 + 1. = - Problem 6. Professor I. M. Nuts of the Math Department is scratching his head over the following problem. Given two sequences of numbers X (x1,...,xn) and Y = (y₁,..., yn) he must find the m≤ √n largest values of the sums xi + Yj, 1 ≤ i, j≤n in SORTED ORDER (smallest to largest). One may assume that m≤ √√n but one must not assume that m is a constant. The proposed algorithm should have worst-case running time that is o(n²). He requests the assistance of the CS Department in dealing with this problem. (a) Give an algorithm whose worst-case running time is o(n²) that solves this problem; an (n²2) time algorithm will not get you any points. (b) Does there exist an algorithm whose worst-case performance is O(n) ? Explain, i.e. show/prove that such an algorithm does not exist or give the algorithm and analyze its performance, if such an algorithm exists. Example. If X = (2,0, -2, -3, 1, 100, 290, 300, 4) and Y (-20, -19,-8, -200, 11, 1, 10, -7,0) and m = 3 then the answer is (301, 310, 311). Note that 301 can result either as the sum of 290 + 11 or 300 + 1. = -
Expert Answer:
Answer rating: 100% (QA)
a Algorithm 1 Initialize a twodimensional array Anm where n is the size of both X and Y and m is the ... View the full answer
Related Book For
Posted Date:
Students also viewed these databases questions
-
A chemist is calibrating a spectrophotometer that will be used to measure the concentration of carbon monoxide (CO) in atmospheric samples. To check the calibration, samples of known concentration...
-
The accounts that will be used by Zant Moving Company follow. Prepare a chart of accounts for the firm. Classify the accounts by type, arrange them in an appropriate order, and assign suitable...
-
The accounts that will be used by Dad & Sons Moving Company follow. Prepare a chart of accounts for the firm. Classify the accounts by type, arrange them in an appropriate order, and assign suitable...
-
EVE, Inc. reported a return on investment of 20%, a sales margin of 25%, and residual income of $480,000. The required rate of return on invested capital is 8%. On the basis of this information, the...
-
Video Game Developers: They are meeting the needs of a target market by developing video games that appeal to that market. Is that a problem? What responsibility do they bear for the potential...
-
In the long run, how will the number of pizza producers change? What are the excess capacity and the deadweight loss created? Explain your answer. Use the following information to work Problems 5 and...
-
Cover up the schedule you constructed as your answer to \(45.1(i)\) and look instead at the break-even chart constructed as the answer to 45.1 (ii). Answer the following: (a) What are the total costs...
-
Carol Carpet manufactures broadloom carpet in seven processes: spinning, dyeing, plying, spooling, tufting, latexing, and shearing. In the Dyeing Department, direct materials (dye) are added at the...
-
Write the following as a fraction. (Enter a reduced fraction.) 91% 11
-
bring this packet with you to every class as this is an ongoing problem. Chart of Accounts 11. Cash 31. Jolene Upton, Capital 12. Accounts receivable 14. Supplies 15. Prepaid rent 16 Prepaid...
-
3. Determine the matrix exponential functions of the following matrices -2] 1 2 0 A2 0 0 0 Az = 0 21 0 A4= 0 2 1 002 10 A1 = 2. 0 20 0 03 (11) Note that A2 and A, are block diagonal matrices, A3 is a...
-
What is the IRR of an investment of \($1,000\) that yields cash flows of \($600\) in each of the first two years?
-
Your grandfather put $1,000 in the bank for you 48 years ago. The bank paid 6 percent interest compounded annually during this time period. How much is your grandfathers deposit worth today?
-
What does redundant hardware mean? Is this an unnecessary cost to a business?
-
What is the break-even price when a company expects to sell 5,000 units, the fixed costs are \($50,000,\) and the variable costs are \($30\) per unit?
-
Alpha makes a product with a fixed cost of \($400,000\) and a variable cost of \($100\) per unit. The sales price is \($200\) per unit. What is the break-even point for the product? How many units...
-
Given the following, what is the current ratio?ItemValueHome$500,000Mortgage$300,000Stock portfolio$15,000Bank accounts$10,000Credit card balances$5,000Automobile$30,000Automobile loan$20,000Question...
-
The May 2014 revenue and cost information for Houston Outfitters, Inc. follow: Sales Revenue (at standard).............. $ 540,000 Cost of Goods Sold (at standard) ..........341,000 Direct Materials...
-
Refer to Exercise 2 in Section 8.2. a. Using each of the three models in turn, predict the NOx emission when Speed = 1500, Torque = 400, and HP = 150. b. Using each of the three models in turn,...
-
The article "Effect of Granular Subbase Thickness on Airfield Pavement Structural Response" (K. Gopalakrishnan and M. Thompson, Journal of Materials in Civil Engineering, 2008:331-342) presents a...
-
A statistics instructor who teaches a lecture section of 160 students wants to determine whether students have more difficulty with one-tailed hypothesis tests or with two-tailed hypothesis tests. On...
-
Is Russia experiencing a net capital inflow? Use the following balance of payments data for Russia (Russian Federation) from the IMF to answer this problem. Assumptions (million US$) 2000 2001 2002...
-
What is Russias total for Groups A and B? Use the following balance of payments data for Russia (Russian Federation) from the IMF to answer this problem. Assumptions (million US$) 2000 2001 2002 2003...
-
What is Russias total for Groups A through C? Use the following balance of payments data for Russia (Russian Federation) from the IMF to answer this problem. Assumptions (million US$) 2000 2001 2002...
Study smarter with the SolutionInn App