2

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.

whuber
  • 281,159
  • 54
  • 637
  • 1,101
Edmon
  • 123
  • 1
  • 6

1 Answers1

2

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}$.

hr0nix
  • 133
  • 7