tags:

views:

73

answers:

2

assume there are three group of high dimension vectors:

{a_1, a_2, ..., a_N},

{b_1, b_2, ... , b_N},

{c_1, c_2, ..., c_N}.

each of my vector can be represented as: x = a_i + b_j + c_k, where 1 <=i, j, k <= N. then the vector is encoded as (i, j, k) wich is then can be decoded as x = a_i + b_j + c_k.

my question is, if there are two vector: x = (i_1, j_1, k_1), y = (i_2, j_2, k_2), is there a method to compute the euclidian distance of these two vector without decode x and y.

+3  A: 

Square root of the sum of squares of the differences between components. There's no other way to do it.

You should scale the values to guard against overflow/underflow issues. Search for the max difference and divide all the components by it before squaring, summing, and taking the square root.

duffymo
A: 

Let's assume you have only two groups. You are trying to compute the scalar product

(a_i1 + b_j1, a_i2 + b_j2)
= (a_i1,a_i2) + (b_j1,b_j2) + (a_i1,b_j2) + (a_i2,b_j1) # <- elementary scalar products

So if you know the necessary elementary scalar products between the elements of your vectors a_i, b_j, c_k, then, you do not need to "decode" x and y and can compute the scalar product directly.

Note that this is exactly what happens when you compute an ordinary euclidian distance on a non orthogonal basis.

Olivier
a_i1, a_i2 ... are all vectors. so i think your result is the upper bound of the distance between (i1,j1,k1) and (i2,j2,k2)
chyojn
I see. I think that you could edit your question to make it clearer.
Olivier
You should use the general tensor relationship to calculate distances in non-euclidian coordinate systems.
duffymo
I see... thank you.Another question, if y is encoded as (a_i, b_j, c_k), and x is not encoded, then the scalar product:(x, a_i + b_j + c_k) = (x, a_i) + (x, b_j) + (x, c_k).am I right?
chyojn
Yes, you are right. But I don't see how that would help...
Olivier