Problem 5. Mom baked pies - three with rice, three with cabbage, and one with cherries - and laid them out in a circle on a plate (see fig.). Then she put the plate in the microwave to warm them up. On the outside, all the pies look the same.

![](https://cdn.mathpix.com/cropped/2024_05_06_03d5e2dee9da9ea28fdcg-04.jpg?height=307&width=311&top_left_y=1516&top_left_x=951)
Masha knows how they were arranged, but she doesn't know how the plate was rotated. She wants to eat the cherry pie, considering the others to be unappetizing. How can Masha definitely achieve this, biting into as few unappetizing pies as possible

[7 points] (A. V. Khachaturyan)

![](https://cdn.mathpix.com/cropped/2024_05_06_03d5e2dee9da9ea28fdcg-05.jpg?height=736&width=917&top_left_y=395&top_left_x=266)
Solution. It is clear that Masha cannot solve the task with one bite. If Masha, for example, tried a cabbage pie, she cannot determine which of the three she got, and therefore cannot confidently find the pie with the cherry.

Let's show how Masha can solve the task in two bites.

Suppose Masha bit into a pie, and it turned out to be not with cherry, but with cabbage. Then she can try the pie that lies one position clockwise from it. If this is the pie with cherry, Masha has achieved her goal; if it is with rice, then the desired pie is between the bitten ones; and if it is again with cabbage, then she should take the next one clockwise, and this will definitely be the pie with cherry.

If the first pie is with rice, Masha can act similarly, but move counterclockwise.

Comment. Masha can act similarly with a larger number of "unpalatable" pies. Suppose there are $N$ cold pies with cabbage on the plate, then a pie with cherry, and again $N$ pies with rice. Masha can notice the middle pie with cabbage (and if $N$ is even, then any of the two middle ones) and remember how many pies she needs to count clockwise to take the pie with cherry. When the pies warm up, Masha tries one pie. Suppose she is unlucky, and it turns out to be with cabbage. Masha can then imagine that she tried the very middle pie and count from it as needed. If she guessed correctly, she will get the cherry, and if not, she will understand whether she is closer to the desired pie than the chosen middle one or farther from it. In any case, the uncertainty is reduced by half: after one attempt, Masha has "under suspicion" no more than half of the pies with cabbage.

A lot of interesting information about problems on the amount of information can be found in the book by K.A. Knop "Weighings and Algorithms: From Puzzles to Problems" (Moscow, MCCME, 2011).