2
$\begingroup$

If I have two positive real numbers that can take on any value between 0 and some finite real number, how do I normalized the difference between these two numbers to [0,1] interval where 0 indicates no similarity and 1 indicates that these two numbers are the same?

Thank you in advance.

$\endgroup$
1
  • $\begingroup$ Several more duplicates can be found by linking through the normalization tag. $\endgroup$
    – whuber
    Dec 15, 2013 at 16:28

1 Answer 1

2
$\begingroup$

If $L$ is the maximum value that any of the two numbers can take, than you can use the expression $sim(a, b) = 1 - \frac{|a-b|}{L}$.

$\endgroup$

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