Maths Olympiad Prep

Library / /711 of 740

, 2014

Combinatorics Difficulty 5.8 AIME, harder Prove it United States

Problem:

For any positive integers aa and bb, define aba \oplus b to be the result when adding aa to bb in binary (base 2), neglecting any carry-overs. For example, 2014=10100211102=110102=2620 \oplus 14=10100_{2} \oplus 1110_{2}=11010_{2}=26. (The operation \oplus is called the exclusive or.) Compute the sum
k=0220141(kk2) \sum_{k=0}^{2^{2014}-1}\left(k \oplus\left\lfloor\frac{k}{2}\right\rfloor\right)
Here x\lfloor x\rfloor is the greatest integer not exceeding xx.

Solution

Solution:

Answer: 22013(220141)\quad 2^{2013}\left(2^{2014}-1\right) OR 24027220132^{4027}-2^{2013}

Let k=a2013a2012a0k=a_{2013} a_{2012} \ldots a_{0} in base 2. Then k2=0a2013a1\left\lfloor\frac{k}{2}\right\rfloor=\overline{0 a_{2013} \ldots a_{1}} in base 2. So the leftmost digit of kk2k \oplus\left\lfloor\frac{k}{2}\right\rfloor is 1 if and only if a2013=1a_{2013}=1, and the nnth digit from the right is 1 if and only if anan1a_{n} \neq a_{n-1} (1n20131 \leq n \leq 2013).

In either case, the probability of each digit being 1 is 12\frac{1}{2}. Therefore, the sum of all such numbers is
1222014111122014 digits =22013(220141) \frac{1}{2} \cdot 2^{2014} \cdot \underbrace{11 \ldots 11_{2}}_{2014 \text{ digits }}=2^{2013}\left(2^{2014}-1\right)

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.