Hamming weight
Hamming weight is a number of nonzero symbols in a string.
All 4 facts, and where they come from
Facts
4 facts · 0 confirmed by two sources · 0 cited · 4 from one source
Where this comes from
Papalocal keeps its own record. It started from these sources; what each one said is kept here as it was copied, so a change on their side never changes this page by itself. Tap one to read its version.
What Wikidata says · copied November 17, 2026 · revision 2528416819
- Described as
- number of nonzero symbols in a string
- Other names
- population count, popcount, popcnt, sideways sum, bit summation
- What it is
- function; property; bitwise operation
- Named after
- Richard Hamming
- Wikipedias with a page
- 15
Wikidata item Q5645805 (wikidata.org/wiki/Q5645805), public domain (CC0). Copied 2026-11-17.
What Wikipedia says · copied November 17, 2026 · revision 1340429552
The Hamming weight of a string is the number of symbols that are different from the zero-symbol of the alphabet used. It is thus equivalent to the Hamming distance from the all-zero string of the same length. For the most typical case, a given set of bits, this is the number of bits set to 1, or the digit sum of the binary representation of a given number and the ℓ₁ norm of a bit vector. In this binary case, it is also called the population count, popcount, sideways sum, or bit summation.
From the Wikipedia article “Hamming weight” (en.wikipedia.org/wiki/Hamming_weight), by its contributors, under CC BY-SA 4.0 (creativecommons.org/licenses/by-sa/4.0/). Copied 2026-11-17; not changed.
Confirmed Two sources agree. Cited One source, and it names where it got it. One source One source, without a reference of its own. Sources disagree The sources disagree. We show the best-supported value and keep theirs below.