10.4. Let's call a snake in a convex $n$-gon an open, non-self-intersecting broken line with $n-1$ segments, the set of vertices of which coincides with the set of all vertices of the $n$-gon. Find the number of different snakes in an $n$-gon. (Snakes are equal if they coincide as geometric loci of points. For example, the number of snakes in a triangle is 3)
Answer. $n \cdot 2^{n-3}$.

Solution. 1) We will prove by induction that the number of snakes, one of whose ends is a fixed vertex $\mathrm{A}$, is $2^{n-2}$. The base case for $n=3$ is obvious. For an arbitrary $n$, we have two possibilities for the segment with end $\mathrm{A}$ - these are the sides $\mathrm{AB}$ and $\mathrm{AC}$ of the $n$-gon, where $\mathrm{B}$ and $\mathrm{C}$ are the vertices adjacent to $\mathrm{A}$. If the first segment $\mathrm{AX}$ is different from $\mathrm{AB}$ and $\mathrm{AC}$, then the diagonal $\mathrm{AX}$ divides the $n$-gon into two non-degenerate polygons with more than three vertices each, counting $\mathrm{A}$ and $\mathrm{X}$. Then the second segment of the snake and all subsequent ones, due to its non-self-intersecting property, will lie in one of them and cannot contain a vertex of the other, different from $\mathrm{A}$ and $\mathrm{X}$, which contradicts the condition. Let the first segment be $\mathrm{AB}$, then the remaining $n-2$ segments of the snake are a snake with the start at $\mathrm{B}$ in the $(n-1)$-gon obtained from the original by removing the triangle $\mathrm{ABC}$. By the inductive hypothesis, there will be $2^{n-3}$ such snakes - this is exactly the number of snakes with the last segment $\mathrm{AB}$. Similarly, the number of snakes with the last segment $\mathrm{AC}$ will also be $2^{n-3}$, so the total number of snakes, one of whose ends is $\mathrm{A}$, will be $2^{n-2}$.

2) Now we multiply $2^{n-2}$ by the number of vertices $n$ and divide by two, since each snake has been counted twice - from each of its ends - in total, there are $n \cdot 2^{n-3}$ snakes.

Grading criteria. Absence of division by two: minus 2 points. Absence of justification that when choosing the next segment of the snake, there are only two possibilities from the "adjacent" vertices: minus 2 points.