Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
sorry for this question, maybe is not the right place here?

Subject: sorry for this question, maybe is not the right place here?

From: Sofia Häggberg

Date: 3 Apr, 2011 18:51:04

Message: 1 of 5

what is the difference between hamming and euclidian distance? I think they're quite similar right...

I actually don't know where elsewhere should I point this question :(

Subject: sorry for this question, maybe is not the right place here?

From: Bruno Luong

Date: 3 Apr, 2011 20:10:19

Message: 2 of 5

"Sofia Häggberg" wrote in message <inafio$reg$1@fred.mathworks.com>...
> what is the difference between hamming and euclidian distance? I think they're quite similar right...

No, They aren't.

Hamming is l1-distance: sum | ai - bi |
Euclidian is l2-distance [ sum | ai - bi |^2 ] ^ (1/2)

In general lp-distance is defined as
 [ sum | ai - bi |^p ] ^ (1/p), where 1 <= p < inf

The limit of lp is called l_infinity and it can be showed as
linf = max_i | ai - bi |

Bruno

Subject: sorry for this question, maybe is not the right place here?

From: Roger Stafford

Date: 3 Apr, 2011 20:45:05

Message: 3 of 5

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <inak7b$73g$1@fred.mathworks.com>...
> "Sofia Häggberg" wrote in message <inafio$reg$1@fred.mathworks.com>...
> > what is the difference between hamming and euclidian distance? I think they're quite similar right...
>
> No, They aren't.
>
> Hamming is l1-distance: sum | ai - bi |
> Euclidian is l2-distance [ sum | ai - bi |^2 ] ^ (1/2)
>
> In general lp-distance is defined as
> [ sum | ai - bi |^p ] ^ (1/p), where 1 <= p < inf
>
> The limit of lp is called l_infinity and it can be showed as
> linf = max_i | ai - bi |
>
> Bruno
- - - - - - - - - -
  I think the Hamming distance is actually an l0 (letter "l") "norm", though it is not really a proper norm.

  See

 http://en.wikipedia.org/wiki/Lp_space
 http://en.wikipedia.org/wiki/Hamming_distance

Roger Stafford

Subject: sorry for this question, maybe is not the right place here?

From: Bruno Luong

Date: 3 Apr, 2011 20:58:05

Message: 4 of 5

"Roger Stafford" wrote in message <inam8h$6u2$1@fred.mathworks.com>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message
> I think the Hamming distance is actually an l0 (letter "l") "norm", though it is not really a proper norm.

Yes, l0 is actually l1 after binarization: logical(a - b).

I believe lately there is a lot of fuss about l0 "norm" associated with the so called compress sensing technique.

Bruno

Subject: sorry for this question, maybe is not the right place here?

From: Greg Heath

Date: 3 Apr, 2011 22:37:04

Message: 5 of 5

On Apr 3, 2:51 pm, "Sofia Häggberg" <mpm...@xmail.com> wrote:
> what is the difference between hamming and euclidian distance? I think they're quite similar right...
>
> I actually don't know where elsewhere should I point this question :(

Wikipedia is always a good start

http://en.wikipedia.org/wiki/Hamming_distance

Hope this helps.

Greg

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us