Alice is playing a game with Bob. They have $1025$ cards, with the numbers $0,1,2,\cdots , 1024$ written on them. Each card contains exactly one number and each number is written on exactly one card. Starting with Alice, they move alternately, taking $512, 256, 128, 64, 32, 16, 8, 4, 2, 1$ cards in that order. In other words, Alice first takes any $512$ cards, then Bob takes any $256$ cards which are not already taken, then Alice $128$ cards not taken, and so on. Finally two cards, say with numbers $a$ and $b$ are left; then Bob pays Alice $|a-b|$ dollars.
Alice wants to obtain as much money as possible, while Bob wants to lose the least possible amount of money.
Assuming both of them play perfectly, what is the maximum amount of money Alice can ensure for herself?
Author: Orlando Dohring