Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am developing web based game in which using lots of formulas to achieve different things. I am using the formulas below. Is there any better way to make these formulas more robust and dynamic like using calculus or any other approach to make them smaller and accurate etc?

$$\mathbf{Basic\ Building\ Cost}=300\text{ gold}+\frac{3}{2}(\text{# of acres}) + (0.1\text{ wood})(\text{# of acres})(\text{science})$$


Armory – Stores weapons and armor $$\mathbf{Cost\ to\ build} = (\text{coal mine cost})+(.5\text{ iron})(\text{# of acres}) + (.5\text{ steel})(\text{# of acres}).$$

Sorry didn't know about the proper tags.

share|cite|improve this question
You could do a bit of factoring. E.g., in the second formula, $$\text{cost to build}=\text {coal mine cost}+(.5)(\text{acres}) (\text{iron} +\text{steel})$$ – David Mitra Jan 19 '12 at 15:15
@pirzada Welcome to math.SE. Please look through FAQ on how to ask a question. Your question lacks focus, does not specify the criteria of improvement of your formula, thus making it difficult to properly answer. The question as is is likely to be closed as either non constructive, or of topic. The title of the question is not indicative of what the question is about either. – Sasha Jan 19 '12 at 15:16
What do you think is the problem with these formulas? Any computer built in the last ten years can store millions of such formulas in memory. – Jay Jan 19 '12 at 15:19
What does "more robust" mean? – Arturo Magidin Jan 19 '12 at 17:42
How can we determine whether the formulae can be made more accurate unless you tell us precisely what you want them to do? – jwodder Jan 19 '12 at 17:48

As a computer programmer, I don't think that's expensive in terms of computing time. I would go with that "formula". Also easier if you decide to change it in the future.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.