# How to find a formula?

I'm trying to find out how some value is calculated in some strategy game. I know the variables that make that value, but not how they are combined to make it. So I gathered some samples:

• c=100 when a=32 and b=1
• c=7 when a=2 and b=1
• c=391 when a=32 and b=12
• c=781 when a=64 and b=12

c is the value I'm trying to find the formula of, and a and b are the only variables in that formula (that are changing between sample to sample). What makes it all harder is that c is rounded either up or down.

I guessed few formulas myself, none applied to all samples. Then I thought there must be a program that could let me enter these samples and estimate a formula for me, but not found such.

Am I in the right direction? is it even possible to do something with such samples?

-

You might try a least-squares fit to some simple form. Without any more information about the sorts of formulas that might be appropriate, I might try $c = p_0 + p_1 a + p_2 b$, which gives not too bad a fit. You gave only four data points, so a form with four degrees of freedom should provide an exact fit, e.g. $c = {\frac {43}{55}}+{\frac {2001}{880}}\,a+{\frac {1}{55}}\,b+{\frac {727 }{880}}\,ab$