TITLE: Is the Number of Carries in Integer-Addition Associative?
QUESTION [10 upvotes]: Is it true that the number of carries, when calculating the sum of a finite set of finite positive integers,  is constant (i.e. independent of their permutation and the order in which the additions are carried out)? Carries are computed in base 2, so that 1+3 is $01_2+11_2=100_2$, which involves 2 carries: the least significant digits resulted in a carry, which then causes a second carry of the 2's digit. 
In case the assumption is wrong, I would also like some ideas for determining the optimal permutation and order of additions.

REPLY [10 votes]: In base $b$, 
let $G_n$  be the set of $n$-digit integers, thought of as the integers mod $b^n$.  Then we have an exact sequence
$$0\rightarrow G_1\rightarrow G_n\rightarrow G_{n-1}\rightarrow 0$$
For $n-1$ digit numbers, the leftmost 
carry digit is the two-cocycle associated to this group extension and therefore satisfies
the cocycle condition
$$c(x,y)+c(x+y,z)=c(y,z)+c(x,y+z)$$ 
In other words, the sum of the leftmost carry digits does not depend on the order of the summands.  
After reducing mod $b^k$, the same argument holds for any other carry digit.