For faster navigation, this Iframe is preloading the Wikiwand page for 汉明距离.

汉明距离

此条目已列出参考文献,但因为没有文内引注而使来源仍然不明。 (2013年3月11日)请加上合适的文内引注来改善这篇条目

信息论中,两个等长字符串之间的汉明距离(英语:Hamming distance)是两个字符串对应位置的不同字符的个数。换句话说,它就是将一个字符串变换成另外一个字符串所需要替换的字符个数。

汉明重量是字符串相对于同样长度的零字符串的汉明距离,也就是说,它是字符串中非零的元素个数:对于二进制字符串来说,就是1的个数,所以11101的汉明重量是4。

范例

[编辑]

例如:

  • 10111011001001之间的汉明距离是2。
  • 21438962233796之间的汉明距离是3。
  • "toned"与"roses"之间的汉明距离是3。

特性

[编辑]

对于固定的长度n,汉明距离是该长度字符向量空间上的度量,很显然它满足非负、唯一及对称性,并且可以很容易地通过完全归纳法证明它满足三角不等式

两个字ab之间的汉明距离也可以看作是特定运算−的ab的汉明重量。

对于二进制字符串ab来说,它等于a 异或b以后所得二进制字符串中“1”的个数。另外二进制字符串的汉明距离也等于n超正方体两个顶点之间的曼哈顿距离,其中n是两个字串的长度。

历史及应用

[编辑]

汉明距离是以理查德·卫斯里·汉明的名字命名的,汉明在误差检测与校正码的基础性论文中首次引入这个概念。在通信中累计定长二进制字中发生翻转的错误数据位,所以它也被称为信号距离。汉明重量分析在包括信息论编码理论密码学等领域都有应用。但是,如果要比较两个不同长度的字符串,不仅要进行替换,而且要进行插入与删除的运算,在这种场合下,通常使用更加复杂的编辑距离等算法。

参考文献

[编辑]

部分摘自Federal Standard 1037C.

理查德·卫斯里·汉明,误差检测与纠错码(Error-detecting and error-correcting codes), Bell System Technical Journal 29 (2):147-160, 1950.

参见

[编辑]
{{bottomLinkPreText}} {{bottomLinkText}}
汉明距离
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?