There are some children sitting around a round table. Each child is given an even amount of $1$-cent coins ($0$ is even) by their teacher, all the children at once. A child will give half his money to the child by his right, then the receiving child gives half of his to the one by his right and it goes on like that. If a child whose turn it is to give has an odd amount of coins, then the teacher gives him an extra coin.
Q : Prove that after several giving and taking, all of these children will have the same amount of $1$-cent coins except one of them who will have twice that amount.
Here is a small python code I wrote to demonstrate the question
def help(c):
n=0
m=len(c)
while (n<len(c)-1):
for i in range(0,m):
if(c[i]%2==0):
c[i]=c[i]/2
else:
c[i]=(c[i]+1)/2
c[(i+1)%m]=c[(i+1)%m]+c[i]
a=c.count(c[0])
b=c.count(c[1])
n=max(a,b)
return c
Suppose there are $n$ children, and make $n+1$ heaps of coins by making a heap for the coins that are in-transit during a transaction. Place this new heap between those two children in our circle. Then the receiving children takes his two heaps, evens them out, and moves to the left, leaving what was previously his heap as the new transfer heap for the next child to the right, and so on.
So we have $n+1$ heaps $c_0 \ldots c_n$, and the procedure we're doing is equivalent to replacing $c_k, c_{k+1}$ with two equal heaps of $\frac {c_k + c_{k+1}}2$ coins, rounded up if necessary. Then increase $k \pmod {n+1}$ and repeat.
Now, look at $\max_{0\le k\le n}\{c_k\}$. This is a decreasing positive sequence, because even with rounding up, we always have $\frac {c_k + c_{k+1}}2 \le \max \{c_k, c_{k+1}\}$. This shows that the total number of coins, which is always less than $(n+1)\max_{0\le k\le n}\{c_k\}$, stays bounded over time. And thus eventually the teacher is going to stop giving out new coins.
Then from that point on, since we're only evening out the different heaps, we can check that the quantity $\sum_{0\le i<j \le n} |c_i-c_j|$ is decreasing, and is strictly decreasing as long as anything non trivial happens : when replacing $c_k$ and $c_{k+1}$ with $\frac {c_k + c_{k+1}}2$, we have $\sum_{0\le i<j \le n} |c'_i-c'_j| - \sum_{0\le i<j \le n} |c_i-c_j| = (\sum_{i \notin \{k,k+1\}} |c_i - c'_k| + |c_i - c'_{k+1}| - |c_i - ck| - |c_i - c_{k+1}|) - |c_k - c_{k+1}| \le - |c_k - c_{k+1}|$ using the triangular inequality.
Since this quantity is positive and decreasing, it is eventually constant, which means that eventually, $c_k = c_{k+1}$ forall $k$ : then every heap has the same size, which is what we needed to show.