Решение задачки от Apple!



Тоже на английском:



You want equal number of heads in each pile. There are currently 10 of them. You don’t know which but it doesn’t matter. All you have to do… take any 10 coins out of the 100, put them into a separate pile, and flip those 10 over. That’s pile #1. Pile #2 is the remaining 90 coins, unflipped. Just leave them. You’re done. Seriously.



You can do this with any number of coins. If you had 20 coins, and 18 were heads, you’d need to take 18 of them (it doesn’t matter which) into a separate pile and flip those 18. That’s pile #1. If you had 10 coins and 3 were heads, you’d take 3 random coins into a new pile and flip those 3 for your first pile, and the rest are your second pile.