Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Hamming weight
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== History and usage == The Hamming weight is named after the American mathematician [[Richard Hamming]], although he did not originate the notion.<ref name="Thompson_1983"/> The Hamming weight of binary numbers was already used in 1899 by [[James Whitbread Lee Glaisher|James W. L. Glaisher]] to give a formula for [[Gould's sequence|the number of odd binomial coefficients]] in a single row of [[Pascal's triangle]].<ref name="Glaisher_1899"/> [[Irving S. Reed]] introduced a concept, equivalent to Hamming weight in the binary case, in 1954.<ref name="Reed_1954"/> Hamming weight is used in several disciplines including [[information theory]], [[coding theory]], and [[cryptography]]. Examples of applications of the Hamming weight include: * In modular [[exponentiation by squaring]], the number of modular multiplications required for an exponent ''e'' is log<sub>2</sub> ''e'' + weight(''e''). This is the reason that the public key value ''e'' used in [[RSA (algorithm)|RSA]] is typically chosen to be a number of low Hamming weight.<ref name="CLNZ"/> * The Hamming weight determines path lengths between nodes in [[Chord (distributed hash table)|Chord distributed hash tables]].<ref name="Stoica_2003"/> * [[IrisCode]] lookups in biometric databases are typically implemented by calculating the [[Hamming distance]] to each stored record.<ref>{{cite journal | last1 = Kong | first1 = A.W.K. | last2 = Zhang | first2 = D. | last3 = Kamel | first3 = M.S. | date = February 2010 | doi = 10.1109/tip.2009.2033427 | issue = 2 | journal = IEEE Transactions on Image Processing | pages = 522β532 | title = An analysis of IrisCode | volume = 19}}</ref> * In [[computer chess]] programs using a [[bitboard]] representation, the Hamming weight of a bitboard gives the number of pieces of a given type remaining in the game, or the number of squares of the board controlled by one player's pieces, and is therefore an important contributing term to the value of a position.<ref>{{cite journal | last = Heinz | first = E.A. | date = September 1997 | doi = 10.3233/icg-1997-20304 | issue = 3 | journal = ICGA Journal | pages = 166β176 | title = How Darkthought plays chess | volume = 20}} Updated and reprinted in ''Scalable Search in Computer Chess'' (Vieweg+Teubner Verlag, 2000), pp. 185β198, {{doi|10.1007/978-3-322-90178-1_13}}</ref> * Hamming weight can be used to efficiently compute [[find first set]] using the identity ffs(x) = pop(x ^ (x - 1)). This is useful on platforms such as [[SPARC]] that have hardware Hamming weight instructions but no hardware find first set instruction.<ref name="SPARC_1992"/><ref name="Warren_2013"/> * The Hamming weight operation can be interpreted as a conversion from the [[unary numeral system]] to [[binary number]]s.<ref name="Blaxell_1978"/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)