Hello, this is not so much about posing a problem for projecteuler but rather a problem I'm trying to figure out for my own reasons.
Suppose I have a game that begins where I have some initial amount M of money. At any point during the game, I can spend my money on investments  there are a variety of different investment options, however each one costs a fixed amount of money (sort of, more on this later), and returns a fixed amount of money.
At a fixed interval that remains constant throughout the game, the total of all investments is added up and the resulting sum is added to my total. The goal is to determine an optimal purchasing strategy.
Obviously we can discretize the times where investments can be purchased since nothing at all happens between the moments where investment benefits are realized. So all that matters is during which interval we made the purchase, but not when. Earlier I mentioned that each investment costs a fixed amount of money. This is not quite true, each investment has a fixed *base price*. the first time you purchase this investment, it costs that amount. However, for each investment of type K that you own, the amount increases by 10% of the base price of K. So if the base price of K is P, and you currently own M instances of K, then purchasing an additional instance of investment K costs P + 0.1*P*M.
I'll give a concrete example. The available investments are as follows:
Investment A  [Base 2000, Quantity 28, Income 50] (Cost $7,600)
Investment B  [Base 500000, Quantity 21, Income 10000] (Cost $1,550,000)
Investment C  [Base 1100000, Quantity 12, Income 16000] (Cost $2,420,000)
A simple approach is to simply determine the cost/income ratio of each investment  that is, the amount of money that you must spend in order to gain an income of $1. Computing that for each of the above we find:
Investment A  C/I = $7,600 / $50 = 152
Investment B  C/I = $1,550,000 / $10,000 = 155
Investment C  C/I = $2,420,000 / $16,000 = 151.25
By this strategy you would want to choose the investment that has the lowest cost/income ratio, Investment C. However, this strategy neglects to take into consideration the fact that more expensive investments must be saved up for, and during the time you're saving you might been better off purchasing a cheaper investment and reaping the benefits from that.
This is where I start getting confused, how to account for this and the cost/income ratio at the same time. One thing I've considered is looking at, based on how much money you currently have on hand and your current income level, how many time steps it would take you to save up for each investment. Of course, some of these will be 0 meaning you can purchase it immediately. By taking the maximum of all these time steps you find which item takes you the longest to purchase. Call this maximum number of time steps N. Then determine for each investment, if you were to purchase that investment as soon as was financially possible, how much money you would have at the beginning of time step N+1 (i.e. after you've had a chance to reap the first benefit from whatever investment took you the longest to save up for).
To illustrate this, consider the previous example with a starting bank of 0 and an income of $3,000 per time step. Time to Buy is as follows:
Investment A  CEIL(7600 / 3000) = 3 [Income in 8073+1 turns = 805*50 = $40,250]
Investment B  CEIL(1550000 / 3000) = 517 [Income in 807517+1 turns = 291*10,000 = $2,910,000]
Investment C  CEIL(2420000 / 3000) = 807 [Income in 807807+1 turns = 1*$16,000 = $16,000]
By this measure, it's better to wait 517 turns and then purchase Investment B, compared to what we found earlier with Investment C.
But this *still* doesn't take into consideration the cost/income ratio of each item. In fact, I can't even decide if it's an important consideration. I also can't decide if this should ultimately be set up as a recurrence relation and searching for the optimal strategy over an infinite number of time steps, or if it's legitimate (or even equivalent) to just consider each time step as a self contained problem as in the example above.
Advice appreciated.
Optimizing a purchasing/income strategy

 Posts: 4
 Joined: Sat Feb 21, 2009 12:44 am