MathLabs

Problem 4

Let a and b be positive integers, and let A and B be finite sets of integers satisfying: (i) A and B are disjoint; (ii) if an integer i belongs either to A or to B, then i+a belongs to A or i-b belongs to B. Prove that a|A|=b|B|, where |X| denotes the number of elements of X.
Step 4 of 5: Compare the sums of elements
∑x∈A∪Bx=∑x∈A∗∪B∗x=∑x∈Ax−a∣A∣+∑x∈Bx+b∣B∣.\sum_{x\in A\cup B}x=\sum_{x\in A^*\cup B^*}x=\sum_{x\in A}x-a|A|+\sum_{x\in B}x+b|B|.
Detailed analysis

Because the two unions are the same disjoint finite set, their element sums agree. Translating A subtracts a from each of |A| elements; translating B adds b to each of |B| elements.