# Finding max and min in a game using calculus.

• Dec 5th 2012, 08:08 PM
elliot24321
Finding max and min in a game using calculus.
Im giving this problem.

You can train 3 different types of armies.
Army type 1, you can train 1 unit in 2 seconds, and will give you power of 4.
Army type 2, you can train 1 unit in 10 second, and will give you power of 8.
Army type 3, you can train 1 unit in 24 seconds, and will give you power of 16.
If you have a limited space of 2.43 billion units.

Question: Using army type 1,2 and/or 3. Find the most efficient way to maximize power, in the least amount of time, before running out of capacity.

Note. you train 3 different armies at the time.
• Dec 6th 2012, 09:35 AM
HallsofIvy
Re: Finding max and min in a game using calculus.
Your question is very ambiguous. You give "training times" in seconds but then say "you have a limited space of 2.43 billion units". What are these units of space? Do you means seconds? And you say "you can train 3 different armies at the time". Do you mean you can train three at the same time, without taking time from the others? You say "before running out of capacity". What is "capacity"? Is that the "units" you talk about?

It would appear that you get 4/2= 2 "power" for each second of training with type 1, 8/10= 4/5 "power" for each second of training with type 2, and 16/24= 2/3 "power" for each second of training with type 3. With the information you give, I would say, first train as many units of type 1, which returns the highest "power" per second that you can. Then, with the units left, train as many units of type 2 that you can, training any left over units as type 1.

Since there are no "continuous functions" involved here, I see no way of using Calculus.
• Dec 6th 2012, 10:34 AM
SworD
Re: Finding max and min in a game using calculus.
The problem I see with this question is you are trying to optimize everything simultaneously which is impossible... clearly, if you want to maximize power, and you have a limited space of units, then ALL your soldiers should be type 3.. but that will take a long amount of time. You can't reach the same power in a lesser time, so how do we determine the tradeoff?

What you are missing is some kind of function, which has time and power as arguments, in order to give a "value" of how efficient the net operation was. We would then seek to maximize the function. For example, you could do, power/time, but then the max capacity would be irrelevant...
• Dec 6th 2012, 01:07 PM
elliot24321
Re: Finding max and min in a game using calculus.

Q:What are these units of space?
A: you can only train a maximum amount of "units" or if you prefer, call them soldiers. So you can train one soldier from type 1 army in 2 seconds, and so forth.
Q:You can train 3 different armies at the time". Do you mean you can train three at the same time, without taking time from the others?
A: Yes, You can train 3 different types of armies at the same time.

The involvement of this problem with calculus. One approach I was thinking was to use lagrange theorem to find a max of a given function, with a constrain.
• Dec 6th 2012, 01:14 PM
elliot24321
Re: Finding max and min in a game using calculus.
SwordD... I completely agree with you, and that's exactly my point... shouldn't there be a combination of the types of armies which can be trained with respect to time, in which time will be limited to when the capacity is max out??
I guess What I'm trying to find is... At what rate of training soldier per time will give me the best increase of power per time, at the same time maximizing my power when I max out my room capacity. Is it really impossible, indeterminate? I'm given all possible values. If not what other values should I be given?

Thanks a lot for ur time.... I really appreciate all the help. By the way this is also my first threat, so please Im open feedback.(Wink)
• Dec 6th 2012, 01:49 PM
elliot24321
Re: Finding max and min in a game using calculus.
I guess, there is different way you can look at the problem from a microeconomics stand point. Where you have 3 production lines, and 3 different products, and each product produces at a different rate with respect to time. In addition one product is more profitable than the other. You also have a warehouse that can only store a limited amount of finished products. Q: At what rate should the owner produce each product in each line in order to have the biggest the rate of change of profit, and at the end it will give maximum profit possible when the warehouse is filled?

Does this help?? Please let me know...

Marginal Cost, Revenue, and Profit

Economists talk about marginal revenue and marginal profit as well. Recall
that the word "marginal" refers to an instantaneous rate of change- that is, a derivative. We now define marginal cost,
revenue, and profit (and redefine cost, revenue, and profit as well.
Marginal Cost, Revenue, and Profit
If x is the number of units of a product produced in some time interval, then
Total cost = C(x)
Marginal cost = C ' (x)
Total revenue = R(x)
Marginal revenue = R ' (x)
Total profit = P(x) = R(x) - C(x)
Marginal profit = P ' (x) = R ' (x) - C ' (x)
Marginal cost (or revenue or profit) is the instantaneous rate of change of cost (or revenue or profit) relative to production
at a given production level.
Remember that when we refer to a cost function C(x) it is understood that C(x) represents the total cost of producing x
items. To find the exact cost of producing a particular item, we use the difference of two successive values of C(x):
Total cost of producing x + 1 items = C(x+1)
Total cost of producing x items = C(x)
Exact cost of producing the (x+1)st item = C(x+1) - C(x)
We can approximate the cost of producing the (x+1)st item using the marginal cost function.
In other words, C '(x) º C(x+1) - C(x).