A point exits from the origin on a line and makes $a$ steps one unit to the right, $b$ steps one unit to the left in some order, with $a > b$. The range of the point's movement is defined as the difference between the greatest and the smallest coordinates of the point during the entire movement.

a) Find the greatest possible range of movement.

b) Find the smallest possible range of movement.

c) How many different sequences of movement exist for the point such that the range of movement is the greatest possible?
b) At the end of its path, the point inevitably has the coordinate $a - b$ (regardless of the order of steps to the right and left). Therefore, the span cannot be less than $a - b$.

Such a span can be achieved, for example, as follows: the point moves right-left exactly $b$ times, and then $a - b$ times to the right.

a) Let the smallest coordinate of the point during the entire random walk be $x \leq 0$. Up to the moment $t$ when the point first reaches this position, it could not have been in points with coordinates greater than $x + b$. After moment $t$, it could not have been in points with coordinates greater than $x + a$. Therefore, the maximum span does not exceed $a$.

Such a span can be achieved, for example, if the point first makes $a$ steps to the right.

c) As seen from a), the maximum span is achieved if all steps to the right are made consecutively. The first step to the right can be the first, second, and so on up to the $(b+1)$-th step (first $b$ steps to the left, and then all steps to the right). Thus, there are $b+1$ ways.

## Answer

a) $a$; b) $a - b$; c) $b + 1$.

What is the maximum number of self-intersection points that a closed broken line with 7 segments can have?

## Solution

Consider the segment $AB$ of this. On segment $AB$, there can be no more than four self-intersection points, since segment $AB$ cannot intersect with segments emanating from vertices $A$ and $B$. Since the broken line has 7 segments and each intersection point involves two segments, the number of self-intersection points does not exceed $7 \cdot 4 / 2 = 14$.

An example of a broken line with 14 self-intersection points is shown in the figure.

![](https://cdn.mathpix.com/cropped/2024_05_06_f68ab0b4ba9161e79ed2g-20.jpg?height=589&width=575&top_left_y=657&top_left_x=730)

## Answer

14 points.