Guess/Find a formula just given input and output.

205 Views Asked by At

I am looking a formula that given the three inputs, gives the output:

$$(7,8,9)=7 \\ (1,3,3)=2 \\ (65,30,74)=56 \\ (9,9,7)=8 \\ (999999999, 999999998, 1000000000 )=999999998 \\ (775140200 ,616574841 ,630329230 )=674014756 \\ (524780569 ,326748594 ,90361407 )=313963523 $$

What I noticed is that when you have a consecutive sequence like in the first case, the result is the minimum. I don't know what to do with the other cases.

2

There are 2 best solutions below

0
On

In all cases the output is less than the average of the inputs. If the average is a whole number the output is one less than the average. if the average is not a whole number the output is the greatest integer less than the average of the inputs.

The greatest integer strictly less than the average works for all cases.

0
On

With the limited examples, $\left \lceil \frac{a+b+c}{3} \right\rceil -1$, where $\left \lceil \cdot \right\rceil $ denotes the ceil or ceiling function seems to work. As the saying goes:

one man's ceiling is another man's floor