Solution. Note that by changing the type of each planted tree to another, we get another way. We will call two such ways complementary. Thus, it is enough to count the number of such pairs. Which tree to plant at the edge is completely determined by its neighbor. Therefore, it is enough to determine the number of ways to plant 4 central trees (without the two edge ones). One type of tree can only be planted in a row twice (a pair). There can be a maximum of two such pairs (4:2=2), and they determine 1 way. One such pair has three possible positions. Two at the edges and one in the center, and we get 3 more ways. And there are no pairs of one type. The last way. In total, 5 ways. But their number needs to be doubled, and the answer is 10 ways.

Another solution.

We will represent trees of one type with dark circles and the other with light circles. And we will start building the tree of planting ways, starting with a black circle. See fig.

![](https://cdn.mathpix.com/cropped/2024_05_06_8db35dc7d14061d444bdg-3.jpg?height=735&width=843&top_left_y=147&top_left_x=205)

It is clear that there are 5 ways. But this number needs to be doubled, since black circles can be planted as birches, and white ones as oaks, and vice versa.

## Grading Criteria.

3 - 4 planting ways are indicated: 1 point.

5 - 6 planting ways are indicated: 2 points.

7 - 9 planting ways are indicated: 3 points.

All ways are indicated, but it is not explained that there are no other ways: 5 points.
4. Vasya must plant 6 trees in a row. Each planted tree is either a birch or an oak. The planting must satisfy the condition: next to each tree of one type, there must be a tree of the other type. In how many different ways can Vasya perform the planting? Two ways are different if there is a spot where different types of trees grow.