exam: HMMT

problem:
Determine the number of ways of walking from $(0,0)$ to $(5,5)$ using only up and right unit steps such that the path does not pass through any of the following points: $(1,1),(1,4),(4,1),(4,4)$.
![](https://cdn.mathpix.com/cropped/2025_01_24_37bc7076f5b85fe20624g-1.jpg?height=281&width=275&top_left_y=754&top_left_x=968)

solution_match: Answer:


solution:
In the following figure, each lattice point (with the bottom-left-most point $(0,0)$ ) is labeled with the number of ways of reaching there from $(0,0)$. With the exception of the forbidden points, the labels satisfy the recursion formula $f(x, y)=f(x-1, y)+f(x, y-1)$. We see from the diagram that there are 34 ways to reach $(5,5)$.

| 1 | 1 | 5 | 17 | 17 | 34 |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 1 | 0 | 4 | 12 | 0 | 17 |
| 1 | 2 | 4 | 8 | 12 | 17 |
| 1 | 1 | 2 | 4 | 4 | 5 |
| 1 | 0 | 1 | 2 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 |

solution_match: Solution:


problem: Let $n>2$ be a positive integer. Prove that there are $\frac{1}{2}(n-2)(n+1)$ ways to walk from $(0,0)$ to $(n, 2)$ using only up and right unit steps such that the walk never visits the line $y=x$ after it leaves the origin.

solution:
The first two steps can only go to the right. Then we need to compute the number of ways of walking from $(2,0)$ to $(n, 2)$ which does not pass through the point $(2,2)$. There are $\binom{n}{2}$ ways to walk from $(2,0)$ to $(n, 2)$, and exactly one of those paths passes through the point (2,2). So the number of valid paths is $\binom{n}{2}-1=\frac{1}{2} n(n-1)-1=\frac{1}{2}(n-2)(n+1)$.

Remark: We used the well-known fact that there are $\binom{a+b}{a}$ ways to walk from $(0,0)$ to $(a, b)$ using only up and right unit steps. This is true because there are $a+b$ steps, and we need to choose $a$ of them to be right steps, and the rest up steps.


problem: Let $n>4$ be a positive integer. Determine the number of ways to walk from $(0,0)$ to $(n, 2)$ using only up and right unit steps such that the path does not meet the lines $y=x$ or $y=x-n+2$ except at the start and at the end.

solution: $\frac{1}{2}\left(n^{2}-5 n+2\right)$


solution: It is easy to see the the first two steps and the last two steps must all be right steps. So we need to compute the number of walks from $(2,0)$ to $(n-2,0)$ that does not pass through $(2,2)$ and $(n-2,0)$. There are $\binom{n-2}{2}$ paths from $(2,0)$ to $(n-2,0)$, and exactly two of them are invalid. So the answer is $\binom{n-2}{2}-2=\frac{1}{2}(n-2)(n-3)-2=\frac{1}{2}\left(n^{2}-5 n+2\right)$.


problem: Let $n>6$ be a positive integer. Determine the number of ways to walk from $(0,0)$ to $(n, 3)$ using only up and right unit steps such that the path does not meet the lines $y=x$ or $y=x-n+3$ except at the start and at the end.

solution:
$\quad \frac{1}{6}(n-6)(n-1)(n+1)$ Consider the first point of the path that lies on $x=3$. There are two possibilities for this point: $(3,0)$ and $(3,1)$, and there is exactly one valid way of getting to each point from the origin. Similarly, consider the last point of the path that lies on $x=n-3$. There are two possibilities: $(n-3,2)$ and $(n-3,3)$, and there is exactly one valid way of getting to the destination from each of the two points. Now we count the number of valid paths from each of $(3,0)$ and $(3,1)$, to each of $(n-3,2)$ and $(n-3,3)$, and the answer will be the sum.

- From $(3,1)$ to $(n-3,2)$ : there are no forbidden points along the way, so there are $n-5$ ways.
- From $(3,0)$ to $(n-3,2)$ : the path must not pass through $(n-3,0)$, and there is exactly one invalid path. So there are $\binom{n-4}{2}-1$ ways.
- From $(3,1)$ to $(n-3,3)$ : the path must not pass through $(3,3)$, and there is exactly one invalid path. So there are $\binom{n-4}{2}-1$ ways.
- From $(3,0)$ to $(n-3,3)$ : the path must not pass through $(n-3,0)$ and $(3,3)$, and there are exactly two invalid paths. So there are $\binom{n-3}{3}-2$ ways.

Summing, we obtain the answer:
$n-5+\binom{n-4}{2}-1+\binom{n-4}{2}-1+\binom{n-3}{3}-2=\frac{n^{3}-6 n^{2}-n+6}{6}=\frac{(n-6)(n-1)(n+1)}{6}$.

## Lattice and Centroids [130]

A d-dimensional lattice point is a point of the form $\left(x_{1}, x_{2}, \ldots, x_{d}\right)$ where $x_{1}, x_{2}, \ldots, x_{d}$ are all integers. For a set of $d$-dimensional points, their centroid is the point found by taking the coordinatewise average of the given set of points.
Let $f(n, d)$ denote the minimal number $f$ such that any set of $f$ lattice points in the $d$-dimensional Euclidean space contains a subset of size $n$ whose centroid is also a lattice point.


problem: Let $S$ be a set of 5 points in the 2 -dimensional lattice. Show that we can always choose a pair of points in $S$ whose midpoint is also a lattice point.

solution: Consider the parities of the coordinates. There are four possibilities: (odd, odd), (odd, even), (even, odd), (even, even). By the pigeonhole principle, two of the points must have the same parity in both coordinates (i.e., they are congruent in mod 2). Then, the midpoint of these two points must be a lattice point.


problem: Construct a set of $2^{d} d$-dimensional lattice points so that for any two chosen points $A, B$, the line segment $A B$ does not pass through any other lattice point.

solution: The simplest example is the set of $2^{d}$ points of the form $\left(a_{1}, a_{2}, \ldots, a_{d}\right)$, where $a_{k} \in\{0,1\}$ for each $k$. This is the set of vertices of a $d$-dimensional cube.


problem:
Show that for positive integers $n$ and $d$,

$$
(n-1) 2^{d}+1 \leq f(n, d) \leq(n-1) n^{d}+1 .
$$

solution: Note that taking the set of points to be a multiset does not affect $f(n, d)$ as adding multiples of $n$ to any of the coordinate values does not change the result. The lower bound is obtained by considering the multiset consisting of $n-1$ copies of each of the $2^{d}$ 0,1 -vectors of length $d$, as it contains no submultiset of size $n$ whose centroid is also a lattice point. By the pigeonhole principle, any multiset of $(n-1) n^{d}+1$ lattice points must contain $n$ points whose coordinates are congruent modulo $n$. The centroid of these $n$ points is also a lattice point, thus proving the upper bound.


problem:
Show that for positive integers $n_{1}, n_{2}$ and $d$,

$$
f\left(n_{1} n_{2}, d\right) \leq f\left(n_{1}, d\right)+n_{1}\left(f\left(n_{2}, d\right)-1\right)
$$

solution: Given a multiset of $f\left(n_{1}, d\right)+n_{1}\left(f\left(n_{2}, d\right)-1\right)$ lattice points, we may select $l=f\left(n_{2}, d\right)$ pairwise disjoint submultisets $S_{1}, S_{2}, \ldots, S_{l}$, each consisting of $n_{1}$ points, whose centroid is a lattice point. Let $\varphi$ map each multiset $S_{i}$ to its centroid $g_{i}$. By the definition of $f\left(n_{2}, d\right)$, there exists a submultiset $T \subset\left\{g_{1}, g_{2}, \ldots, g_{l}\right\}$ satisfying $|T|=n_{2}$ whose centroid is a lattice point. Then $\bigcup_{i \in T} \varphi^{-1}\left(g_{i}\right)$ is a multiset of $n_{1} n_{2}$ lattice points whose centroid is also a lattice point.


problem: Determine, with proof, a simple closed-form expression for $f\left(2^{a}, d\right)$.

solution: $\left(2^{a}-1\right) 2^{d}+1$


solution:
From Problem ??, $f\left(2^{a}, d\right) \geq\left(2^{a}-1\right) 2^{d}+1$. We prove by induction on $a$ that $f\left(2^{a}, d\right) \leq\left(2^{a}-1\right) 2^{d}+1$. When $a=1$, Problem ?? shows that $f(2, d) \leq 2^{d}+1$. Fix $a>1$ and suppose that the assertion holds for smaller values of $a$. Using Problem ??,

$$
\begin{aligned}
f\left(2^{a}, d\right) & \leq f(2, d)+2\left(f\left(2^{a-1}, d\right)-1\right) \\
& \leq 2^{d}+1+2 \cdot\left(2^{a-1}-1\right) 2^{d} \\
& =\left(2^{a}-1\right) 2^{d}+1 .
\end{aligned}
$$

Thus $f\left(2^{a}, d\right)=\left(2^{a}-1\right) 2^{d}+1$.

## Incircles [180]

In the following problems, $A B C$ is a triangle with incenter $I$. Let $D, E, F$ denote the points where the incircle of $A B C$ touches sides $B C, C A, A B$, respectively.
![](https://cdn.mathpix.com/cropped/2025_01_24_37bc7076f5b85fe20624g-4.jpg?height=375&width=334&top_left_y=235&top_left_x=890)

At the end of this section you can find some terminology and theorems that may be helpful to you.


problem:
On the circumcircle of $A B C$, let $A^{\prime}$ be the midpoint of arc $B C$ (not containing $A$ ).
(a) $[\mathbf{1 0}]$ Show that $A, I, A^{\prime}$ are collinear.
(b) $[\mathbf{2 0}]$ Show that $A^{\prime}$ is the circumcenter of BIC.

solution:
![](https://cdn.mathpix.com/cropped/2025_01_24_37bc7076f5b85fe20624g-4.jpg?height=386&width=351&top_left_y=1002&top_left_x=933)
(a) Since $A^{\prime}$ bisectors the arc $B C$, the two arcs $A^{\prime} B$ and $A^{\prime} C$ are equal, and so $\angle B A A^{\prime}=$ $\angle C A A^{\prime}$. Thus, $A^{\prime}$ lies on the angle bisector of $B A C$. Since $I$ also lies on the angle bisector of $B A C$, we see that $A, I, A^{\prime}$ are collinear.
(b) We have

$$
\angle C I A^{\prime}=\angle A^{\prime} A C+\angle I C A=\angle A^{\prime} A B+\angle I C B=\angle A^{\prime} C B+\angle I C B=\angle I C A^{\prime} .
$$

Therefore, $A^{\prime} I=A^{\prime} C$. By similar arguments, $A^{\prime} I=A^{\prime} B$. So, $A^{\prime}$ is equidistant from $B, I, C$, and thus is its circumcenter.

solution_match: ## Solution:


problem: Let lines $B I$ and $E F$ meet at $K$. Show that $I, K, E, C, D$ are concyclic.

solution:
First, note that there are two possible configurations, as $K$ could lie inside segment $E F$, or on its extension. The following proof works for both cases. We have
![](https://cdn.mathpix.com/cropped/2025_01_24_37bc7076f5b85fe20624g-4.jpg?height=472&width=478&top_left_y=2030&top_left_x=867)

$$
\angle K I C=\angle I B C+\angle I C B=\frac{1}{2} \angle A B C+\frac{1}{2} \angle A C B=90^{\circ}-\frac{1}{2} \angle B A C=\angle A E F .
$$

It follows that $I, K, E, C$ are concyclic. The point $D$ also lies on this circle because $\angle I D C=$ $\angle I E C=90^{\circ}$. Thus, all five points are concyclic.


problem: Let $K$ be as in the previous problem. Let $M$ be the midpoint of $B C$ and $N$ the midpoint of $A C$. Show that $K$ lies on line $M N$.

solution:
Since $I, K, E, C$ are concyclic, we have $\angle I K C=\angle I E C=90^{\circ}$. Let $C^{\prime}$ be the reflection of $C$ across $B I$, then $C^{\prime}$ must lie on $A B$. Then, $K$ is the midpoint of $C C^{\prime}$. Consider a dilation centered at $C$ with factor $\frac{1}{2}$. Since $C^{\prime}$ lies on $A B$, it follows that $K$ lies on $M N$.
![](https://cdn.mathpix.com/cropped/2025_01_24_37bc7076f5b85fe20624g-5.jpg?height=473&width=478&top_left_y=796&top_left_x=867)


problem: Let $M$ be the midpoint of $B C$, and $T$ diametrically opposite to $D$ on the incircle of $A B C$. Show that $D T, A M, E F$ are concurrent.

solution:
If $A B=A C$, then the result is clear as $A M$ and $D T$ coincide. So, assume that $A B \neq A C$.
![](https://cdn.mathpix.com/cropped/2025_01_24_37bc7076f5b85fe20624g-5.jpg?height=554&width=568&top_left_y=1596&top_left_x=822)

Let lines $D T$ and $E F$ meet at $Z$. Construct a line through $Z$ parallel to $B C$, and let it meet $A B$ and $A C$ at $X$ and $Y$, respectively. We have $\angle X Z I=90^{\circ}$, and $\angle X F I=90^{\circ}$. Therefore, $F, Z, I, X$ are concyclic, and thus $\angle I X Z=\angle I F Z$. By similar arguments, we also have $\angle I Y Z=\angle I E Z$. Thus, triangles $I F E$ and $I X Y$ are similar. Since $I E=I F$, we must also have $I X=I Y$. Since $I Z$ is an altitude of the isosceles triangle $I X Y, Z$ is the midpoint of $X Y$.

Since $X Y$ and $B C$ are parallel, there is a dilation centered at $A$ that sends $X Y$ to $B C$. So it must send the midpoint $Z$ to the midpoint $M$. Therefore, $A, Z, M$ are collinear. It follows that $D T, A M, E F$ are concurrent.


problem: Let $P$ be a point inside the incircle of $A B C$. Let lines $D P, E P, F P$ meet the incircle again at $D^{\prime}, E^{\prime}, F^{\prime}$. Show that $A D^{\prime}, B E^{\prime}, C F^{\prime}$ are concurrent.

solution:
Using the trigonometric version of Ceva's theorem, it suffices to prove that

$$
\frac{\sin \angle B A D^{\prime}}{\sin \angle D^{\prime} A C} \cdot \frac{\sin \angle C B E^{\prime}}{\sin \angle E^{\prime} B A} \cdot \frac{\sin \angle A C F^{\prime}}{\sin \angle F^{\prime} C B}=1 .
$$

![](https://cdn.mathpix.com/cropped/2025_01_24_37bc7076f5b85fe20624g-6.jpg?height=559&width=587&top_left_y=753&top_left_x=818)

Using sine law, we have

$$
\sin \angle B A D^{\prime}=\frac{F D^{\prime}}{A D^{\prime}} \cdot \sin \angle A F D^{\prime}=\frac{F D^{\prime}}{A D^{\prime}} \cdot \sin \angle F D D^{\prime}
$$

Let $r$ be the inradius of $A B C$. Using the extended sine law, we have $F D^{\prime}=2 r \sin \angle F D D^{\prime}$. Therefore,

$$
\sin \angle B A D^{\prime}=\frac{2 r}{A D^{\prime}} \cdot \sin ^{2} \angle F D D^{\prime}
$$

Do this for all the factors in ( $\dagger$ ), and we get

$$
\frac{\sin \angle B A D^{\prime}}{\sin \angle D^{\prime} A C} \cdot \frac{\sin \angle C B E^{\prime}}{\sin \angle E^{\prime} B A} \cdot \frac{\sin \angle A C F^{\prime}}{\sin \angle F^{\prime} C B}=\left(\frac{\sin \angle F D D^{\prime}}{\sin \angle D^{\prime} D E} \cdot \frac{\sin \angle D E E^{\prime}}{\sin \angle E^{\prime} E F} \cdot \frac{\sin \angle E F F^{\prime}}{\sin \angle F^{\prime} F D}\right)^{2}
$$

Since $D D^{\prime}, E E^{\prime}, F F^{\prime}$ are concurrent, the above expression equals to 1 by using trig Ceva on triangle $D E F$. The result follows.

Remark: This result is known as Steinbart Theorem. Beware that its converse is not completely true. For more information and discussion, see Darij Grinberg's paper "Variations of the Steinbart Theorem" at http://de.geocities.com/darij_grinberg/.

## Glossary and some possibly useful facts

- A set of points is collinear if they lie on a common line. A set of lines is concurrent if they pass through a common point. A set of points are concyclic if they lie on a common circle.
- Given $A B C$ a triangle, the three angle bisectors are concurrent at the incenter of the triangle. The incenter is the center of the incircle, which is the unique circle inscribed in $A B C$, tangent to all three sides.
- Ceva's theorem states that given $A B C$ a triangle, and points $X, Y, Z$ on sides $B C, C A, A B$, respectively, the lines $A X, B Y, C Z$ are concurrent if and only if

$$
\frac{B X}{X B} \cdot \frac{C Y}{Y A} \cdot \frac{A Z}{Z B}=1
$$

- "Trig" Ceva states that given $A B C$ a triangle, and points $X, Y, Z$ inside the triangle, the lines $A X, B Y, C Z$ are concurrent if and only if

$$
\frac{\sin \angle B A X}{\sin \angle X A C} \cdot \frac{\sin \angle C B Y}{\sin \angle Y B A} \cdot \frac{\sin \angle A C Z}{\sin \angle Z C B}=1 .
$$