English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have ordered list of real numbers. Instead of having integer order number for each element (1, 2,...), I would like to have order numbers that reflect the proximity between two elements. For example, if 4th element's value is 0.5678 and 5th element has value of 0.5682, I want to have order number for 5th element to be something like 4.12 because two numbers are very close.
Are there any methods to do things like this?

2007-12-22 20:57:38 · 2 answers · asked by Anonymous in Science & Mathematics Chemistry

2 answers

I don't think it's clear what you're asking. Are you saying you want to assign a value to each point based on the difference between it and the previous value?

Say x[i] represents the i th element, meaning "i" is a subscript.

What if you use a formula like
f [i] = exp( -k | x[i] - x[i-1] | )

where f[i] is the proximity index you're interested in
k is some constant that you choose
and | | denotes absolute value.

Of course you could get rid of the absolute value
Another function you could use instead of the exponential is
1 / (x[i] - x[i-1])
It's all up to you, I think.

In both cases, this proximity variable will be larger when the successive values of x are closer.

2007-12-22 21:15:15 · answer #1 · answered by nicholasm40 3 · 0 0

If your lowest is x and your highest is y, then for any number z in that range you can define an ordering parameter

P = (z-x)/(y-x)

to be in the right order and run from 0 to 1. I guess this may be what you want. (Nothing special about this P; I just made it up)

But strictly speaking, ordinals have to be integers. You can include as many intermediate numbers in P as you like, but you can't introduce anythng between, say, "first" and "second".

You might do better asking under math.

2007-12-22 22:15:18 · answer #2 · answered by Facts Matter 7 · 0 0

fedest.com, questions and answers