Digital sum in base b
Encyclopedia
The digital sum in base b of a set of natural number
Natural number
In mathematics, the natural numbers are the ordinary whole numbers used for counting and ordering . These purposes are related to the linguistic notions of cardinal and ordinal numbers, respectively...

s is calculated as follows: express each of the numbers in base
b
Numeral system
A numeral system is a writing system for expressing numbers, that is a mathematical notation for representing numbers of a given set, using graphemes or symbols in a consistent manner....

, then take the sum of corresponding digits and discard all carry overs. That is, the digital sum is the same as the normal sum except that no carrying is used.

For example in decimal
Decimal
The decimal numeral system has ten as its base. It is the numerical base most widely used by modern civilizations....

 (base 10) arithmetic, the digital sum of 123 and 789 is 802:
  • 3 + 9 = 12, discard the 10 leaving 2.
  • 2 + 8 = 10, discard the 10 leaving 0.
  • 1 + 7 = 8, there is no carry to discard.

123
789
---
802

More usually the digital sum is calculated in binary
Binary numeral system
The binary numeral system, or base-2 number system, represents numeric values using two symbols, 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2...

 (base 2) where the result only depends upon whether there are an even or odd number of 1s in each column. This is the same function as parity or multiple exclusive ors.

For example:
011 (3)
100 (4)
101 (5)
---
010 (2) is the binary digital sum of 3, 4 and 5.

The binary digital sum is crucial for the theory of the game of nim
Nim
Nim is a mathematical game of strategy in which two players take turns removing objects from distinct heaps. On each turn, a player must remove at least one object, and may remove any number of objects provided they all come from the same heap....

.

The digital sum in base b is an associative and commutative operation
Binary operation
In mathematics, a binary operation is a calculation involving two operands, in other words, an operation whose arity is two. Examples include the familiar arithmetic operations of addition, subtraction, multiplication and division....

 on the natural number
Natural number
In mathematics, the natural numbers are the ordinary whole numbers used for counting and ordering . These purposes are related to the linguistic notions of cardinal and ordinal numbers, respectively...

s; it has 0 as neutral element and every natural number has an inverse element
Inverse element
In abstract algebra, the idea of an inverse element generalises the concept of a negation, in relation to addition, and a reciprocal, in relation to multiplication. The intuition is of an element that can 'undo' the effect of combination with another given element...

 under this operation. The natural numbers together with the base-
b digital sum thus form an abelian group
Abelian group
In abstract algebra, an abelian group, also called a commutative group, is a group in which the result of applying the group operation to two group elements does not depend on their order . Abelian groups generalize the arithmetic of addition of integers...

; this group is isomorphic
Group isomorphism
In abstract algebra, a group isomorphism is a function between two groups that sets up a one-to-one correspondence between the elements of the groups in a way that respects the given group operations. If there exists an isomorphism between two groups, then the groups are called isomorphic...

 to the direct sum of a countable
Countable set
In mathematics, a countable set is a set with the same cardinality as some subset of the set of natural numbers. A set that is not countable is called uncountable. The term was originated by Georg Cantor...

 number of copies of Z/
bZ
Modular arithmetic
In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" after they reach a certain value—the modulus....

.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK