There are balance scales without weights and 3 identical-looking coins, one of which is counterfeit: it is lighter than the genuine ones (the genuine coins weigh the same). How many weighings are needed to determine the counterfeit coin? Solve the same problem in the cases where there are 4 coins and 9 coins.