1. Count all coins, lets say there are 13 coins, to make it easy to understand (it works equally wel if you say x=10+y, where y is the number of tails - in my case that's 3).
2. Put 3 coins in one group, and 10 coins in the other group, and flip all of them.
3. Now fil all coins in the left group again, and you are done.
How it works:
After step 2, we have three heads in total, these are the possibilities (in a table for group L(eft) and group R(ight)):
L|R
---
3|0
2|1
1|2
0|3
- So in the first case, if we flip all 3 coins, there are only tails, so 0 heads in both groups.
- In the second case, there is one head in the right group. In the left group, there are two heads and 1 tail. Flip all of those, than there is 1 head in the left group, and 1 in the right group.
- ...