Coin-tossing problem