Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider two possible investments A and B; each year, an oracle tells you the return of the investments for the each of the n next

Consider two possible investments A and B; each year, an oracle tells you the return of the
investments for the each of the n next years. This can be represented by arrays A =[a1,..., an]
and B =[b1,..., bn](you can assume that these are always correct). At the beginning of each year
i, you can place all your investment money entirely in A or entirely in B. It is guaranteed that
your money should multiply by ai (if you invested in A) or by bi (if you invested in B) by the end
of year i. However, if you move your money from A to B or B to A when transitioning to the next
year, you lose half your money.
Given the return on investments for the next n years as arrays of multipliers A =[a1,..., an]
and B =[b1,..., bn], design an algorithm to determine the maximum multiplier you can achieve
on your initial investment by the end of year n.
Example: Lets say that A =[4,2,3,1] and B =[1,2,3,3]. You should place your money in
investment A in years 1,2, and 3(to have your initial investment multiply by 423=24). Then,
you would transfer your money from A to B, which would cut your money in half (now you only
have a 12x multiplier on your initial investment). By the end of year 4, you would achieve a 36x
multipler on your initial investment. Your algorithm should return 36 in this case.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals of Financial Management

Authors: Eugene F. Brigham, Joel F. Houston

Concise 6th Edition

324664559, 978-0324664553

More Books

Students also viewed these Finance questions

Question

3. Provide time for independent and extended projects.

Answered: 1 week ago

Question

Pollution Human Activities?

Answered: 1 week ago

Question

Major global environmental Threats ?

Answered: 1 week ago

Question

Socratic method ?

Answered: 1 week ago