ZhangZhihui's Blog  

 

     MDS, PCoA

 

 

     

 

 

 

     

 

 

 

 

          

 

          

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Hamming distance is a metric used to measure how many positions at which the corresponding elements (usually bits or characters) of two strings are different.


🔢 Definition

For two strings of equal length, the Hamming distance is the number of positions where the characters (or bits) differ.

Example

Let’s compare two binary strings:

  • A = 1011101

  • B = 1001001

Compare position by position:

A: 1 0 1 1 1 0 1  
B: 1 0 0 1 0 0 1  
   ↑   ↑   ↑     → 3 positions differ

Hamming distance = 3

 

 

 

posted on 2025-07-18 17:59  ZhangZhihuiAAA  阅读(8)  评论(0)    收藏  举报