To each vertex of a pentagon, we assign an integer $x_i$ with sum $$s=\sum x_i>0$$ If $x$, $y$, $z$ are the numbers assigned to three successive vertices and if $y<0$ , then we replace $(x, y, z)$ by $(x+y, -y, z+y)$. This step is repeated as long as there is a $y<0$. Decide if the algorithm always stop .
I know this question is already asked, but my question is, how much steps are needed until stop??
Consider a finite miultiset $S$ of all sums defined by $$s(i, j)= \sum_{k=i}^{j-1}x_k,$$ where $1≤i≤5$ and $j>i$.
A multiset is a set which can have equal elements.
In this set, all elements, except for one, either remain invariant or are switched with others. Only $s(4, 5)=x_4$; however, if $x_4<0$ then we have $s(4, 5) = -x_4$. Thus, exactly one negative element of $S$ becomes positive for each step. Since $s > 0$, $S$ contains only finitely many negative elements. The number of steps until stop is equal to the number of negative elements of $S$. We see that the $x_i$ need not be integers.