Consider the following (unrealistic!) investment problem.We have a set S of n potential investments, each give?
-
Consider the following (unrealistic!) investment problem.We have a set S of n potential investments, each given by a pair of floating point numbers (amount, estimated return) There is a total amount A to invest; we want to select investments to maximise the return on this amount. One may select each investment (a,r) as a whole (spending all of a, and getting r return) or only can select only a fraction f (spending (f*a), and getting (f*r) return). The estimated return of a set of selections is the sum of the returns of the individual selections. Obviously, in selecting elements of S, we cannot spend more than the total amount A available. Describe an efficient algorithm for computing the maximum estimated return that can be realised with amount A and set of investments S. What is the time complexity of your algorithm (in big-oh notation)? Is it the best possible? It is fine to describe your algorithm in words and/or pseudocode; there's no need to include code in a programming language. Sent from my BlackBerry® wireless handheld from Glo Mobile
-
Answer:
This question is dumb. You sort the investments by return and then take all of the highest return investment, and continue taking the most of each investment in turn until you have exhausted your funds. The complexity of the investment is just the complexity of your sort algorithm which is likely not better than O(n log n).
CHAIRMAN at Yahoo! Answers Visit the source
Related Q & A:
- How many regions are created by the set of all hyperplanes defined by a set of points?Best solution by Mathematics
- Should I give her a Valentine's Day gift?Best solution by Yahoo! Answers
- Do a country’s imports completely measure the market potential for a product? Why or why not?Best solution by Yahoo! Answers
- Do I have to have a bachelor's degree before going for a master's degree in the U.S?Best solution by Yahoo! Answers
- For a U.S. Passport, what's the difference exactly between a passport book and a passport card?Best solution by ChaCha
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.