Measures of distance between two n-dimensional points, Hamming distance and Euclidean distance

Posted on Sep 12th, 2009 At 11:14 pm by baldo

Proposition

Let and be two vectors in n-dimensional Euclidean space, subject to the condition , so that both vectors x,y are also in Hamming space.

Hamming space is defined by:

where:

is a set of n-dimensional vectors, each component is a real number

condition that each component is restricted to the values

Relationship

The Hamming distance has a relationship to the Euclidean distance according to the following formulas:

Euclidean distance

The Euclidean distance (d) between two n-dimensional vectors is given by:

Which can be reduced to:

where:

#dc is the number of components that are different between x and y

Since:

Note: the Hamming distance can be determined according to the prior relationship

Exercises:

1.- Determine the Hamming distance between ,

2.- Write a C/C++ program to determine the hamming distance between ,

Category: Math