How to determine formula for know results?

584 Views Asked by At

I have the following information:

| Input  | Output 1 | Output 2 | Total |
|--------|----------|----------|-------|
| 5, 5   | 18       | 7        | 25    |
| 11, 11 | 72       | 49       | 121   |
| 19, 21 | 220      | 179      | 399   |
| 31, 33 | 544      | 479      | 1023  |

The inputs are always both odd numbers. 'Output 1' is always even. 'Output 2' is always odd. The total is the product of the inputs. The total is the sum of both outputs.

How can I determine a formula that will calculate the out based on input (x, y)?

1

There are 1 best solutions below

1
On BEST ANSWER

One simple formula that works is this : Input $(x,y)$ results in Output :

$$\frac{(x+1)(y+1)}{2}$$

Of course we can build tons of formulas based on this like

Input $(x,y)$ results in Output : $$\frac{(x+1)(y+1)}{2}+1000(x-5)(x-11)(x-19)(x-31)y^{2015}$$

but maybe this simple formula is what you're looking for .

EDIT For Output 2 we have the formula (with the same notation) :

Output 2 : $\frac{xy-x-y-1}{2}$

and for Total the formula is simply

Total : $xy$

Of course as earlier we can build a lot more functions that work .