You are not logged in.
Pages: 1
Hello,
Does anyone know of a method to calculate the percentage of closeness to an ideal number?
For example, My ideal number is 40, two actual numbers are 38 and 82, the actual number 38 should be a high percentage as it is closest to 40 therefore 82 should be a fair bit lower. As the difference from the ideal increases the percentage approaches 0.
Hope someone can help me
Thank you
Ray
well, im not sure why you would use a percentage, doesnt really fit the context, but you might do it like this:
might that work for you?
Last edited by luca-deltodesco (2007-01-24 01:39:58)
The Beginning Of All Things To End.
The End Of All Things To Come.
Offline
Yes Thank you, that should work fine,
Percentage is for display and comparison
Thank you again
Ray
Although this would mean that every number with a difference greater than 2 will be under 50% and a difference of 1 would mean that it is 100%.
This will suffice for now, but I would like to challenge you further to find an equation that would distribute the percentage equally.
So a difference of 1 would be 99% (or there abouts) and a difference of 0 would be 100%
Note that this difference is not within a given range so f(x) = x + 100 or something like that doesn't work in this case (x being the difference).
Thanks
Raymond
Wow , there is such wonderful thing? I totally miss it. (quickly write down the forumla)
Numbers are the essence of the Universe
Offline
Right on 40 is 100%:
Last edited by John E. Franklin (2007-01-24 15:23:28)
igloo myrtilles fourmis
Offline
The best solution i can come up with is a simple function
f(x) = a^(x/b) * 100 where a and b are constants
with a difference value of 2 the percentage would be 95.87% and with a difference of 42 it is 41.27
the constants are used to vary the range and domain of the function (i think).
Thanks for all your help
Ray
Also when x is zero, f(x) is 100
Pages: 1