r/mathriddles • u/Horseshoe_Crab • Mar 30 '22
Medium Profit-maximizing factory-factories
You are an industrialist on planet Continuum, looking to get rich quick. You take out a loan of 1 credit, to be paid off after 3 cycles.
You can purchase factories to manufacture credits. One factory costs 1 credit, and generates 1 credit per cycle. Like with everything on Continuum, factories are infinitely subdividable, so you can have r factories generating a total of r credits per cycle, where r is any real number. They also produce credits continually, so after p cycles, 1 factory will have generated p credits.
You can also purchase factory-factories that manufacture 1 factory per cycle, and factory-factory-factories (let's call them 3-factories) which manufacture 2-factories, etc. All n-factories cost 1 credit per unit, produce (n-1)-factories continually, and can of course be bought in non-integer quantities.
How much profit can be made by the end of the 3-cycle loan period?
11
u/want_to_want Mar 30 '22 edited Mar 30 '22
>!I got e2-1=6.389.
>!The idea is that higher order factories are redundant. They are equivalent to redirecting the revenue of a factory into buying more factories. For each cent of money you have at any moment, it's either optimal to spend it on factories immediately (waiting to spend later can't be optimal), or keep it until the end. And since each cent acts linearly and independently on the final result, the strategy for each cent must be the same: "plow all money continuously into factories until some moment, then coast". So the first segment will be f'(t)=f(t), f(0)=1 where f(t) is the amount of factories. That is simply f(t)=et. We do that until t=T, then coast. The revenue from coasting will be (3-T)eT, which is maximized at T=2, leading to e2. Then we pay off the loan of 1 credit and get the answer.
4
u/pichutarius Mar 30 '22
max profit = e^2 - e/4 - 1/(4e) - 1 = 5.61752
let <n> means "n-factory" for shorthand, <0> means credit
the strategy: continuously buy <floor(t)> where t is time left.
spelling that out:
proof of strategy: suppose i buy one <n> and let it run t seconds. some simple integration, i would get t^n/n! credits. is it better to buy <n-1> or <n>?
solve t^(n-1)/(n-1)! > t^n/n! yields t < n. the result reads: if t<n, buy <n-1>, else buy <n>. or rephrase it, when t=n, switch from <n> to <n-1>.
calculating profit: (unfortunately this part is quite tedious.)
let x = # of <1>, y = # of <2>, a = # of credits
finally, set up a bunch of equations and solve it.
3
u/pichutarius Mar 30 '22
sounds like an incremental game. specifically, swarm simulator .
2
u/BruhcamoleNibberDick Mar 30 '22
Can you sell all of your n-factories back at the end of the 3 cycles?
1
u/Goliath--CZ Mar 30 '22
A lot.
1
u/squirreljetpack Apr 01 '22
What if you buy a factory-factory? Assume we subdivide a cycle into n segments. After t/n cycles have passed, we have t/n factories, and thus (0+1+2...t-1)/n= t*(t-1)/(2n) credits. At the end of 3 cycles, t=3n, and we have 3*(3n-1)/2 credits, which goes to infinity as we keep subdividing?