Function needed when combining two variables

80 Views Asked by At

I would like some suggestions of functions to solve a problem.

I need to construct a function of two variables, where the lower limit of this variables are 0 and the upper one is 100. And the ouput of the function is from 0 to 100 too.

f: [0,100]x[0,100] -> [0,100]

And if x and y (the inputs) are similar the value is higher but when they differ the value is smaller, for example, like these ones:

(0, 0) -> 100
(0, 50) -> 50
(0, 100) -> 0

(50, 0) -> 50
(50, 50) -> 100
(50, 100) -> 50

(100, 0) -> 0
(100, 50) -> 50
(100, 100) -> 100

Someone have a suggestion?

1

There are 1 best solutions below

1
On BEST ANSWER

One possible function could be $f(x,y)=100-|x-y|.$