Maths Olympiad Prep

Library / HMMT November /644 of 672

HMMT November, 2014

Combinatorics Difficulty 5.8 AIME, harder Prove it United States

Problem:

For any positive integers aa and bb, define a⊕ba \oplus b to be the result when adding aa to bb in binary (base 2), neglecting any carry-overs. For example, 20⊕14=101002⊕11102=110102=2620 \oplus 14=10100_{2} \oplus 1110_{2}=11010_{2}=26. (The operation ⊕\oplus is called the exclusive or.) Compute the sum
∑k=022014−1(k⊕⌊k2⌋) \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(22014−1)\quad 2^{2013}\left(2^{2014}-1\right) OR 24027−220132^{4027}-2^{2013}

Let k=a2013a2012…a0k=a_{2013} a_{2012} \ldots a_{0} in base 2. Then ⌊k2⌋=0a2013…a1‾\left\lfloor\frac{k}{2}\right\rfloor=\overline{0 a_{2013} \ldots a_{1}} in base 2. So the leftmost digit of k⊕⌊k2⌋k \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 an≠an−1a_{n} \neq a_{n-1} (1≤n≤20131 \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
12⋅22014⋅11…112⏟2014 digits =22013(22014−1) \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,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

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