exam: HMMT

problem: Jacob flips five coins, exactly three of which land heads. What is the probability that the first two are both heads?

solution: $\frac{3}{10}$ We can associate with each sequence of coin flips a unique word where $H$ represents heads, and T represents tails. For example, the word HHTTH would correspond to the coin flip sequence where the first two flips were heads, the next two were tails, and the last was heads. We are given that exactly three of the five coin flips came up heads, so our word must be some rearrangement of HHHTT. To calculate the total number of possibilities, any rearrangement corresponds to a choice of three spots to place the H flips, so there are $\binom{5}{3}=10$ possibilities. If the first two flips are both heads, then we can only rearrange the last three HTT flips, which corresponds to choosing one spot for the remaining $H$. This can be done in $\binom{3}{1}=3$ ways. Finally, the probability is the quotient of these two, so we get the answer of $\frac{3}{10}$. Alternatively, since the total number of possiblities is small, we can write out all rearrangements: HHHTT, HHTHT, HHTTH, HTHHT, HTHTH, HTTHH, THHHT, THHTH, THTHH, TTHHH. Of these ten, only in the first three do we flip heads the first two times, so we get the same answer of $\frac{3}{10}$.

solution_match: Answer:


problem: How many sequences $a_{1}, a_{2}, \ldots, a_{8}$ of zeroes and ones have $a_{1} a_{2}+a_{2} a_{3}+\cdots+a_{7} a_{8}=5$ ?

solution:
9 First, note that we have seven terms in the left hand side, and each term can be either 0 or 1 , so we must have five terms equal to 1 and two terms equal to 0 . Thus, for $n \in\{1,2, \ldots, 8\}$, at least one of the $a_{n}$ must be equal to 0 . If we can find $i, j \in\{2,3, \ldots, 7\}$ such that $a_{i}=a_{j}=0$ and $i<j$, then the terms $a_{i-1} a_{i}, a_{i} a_{i+1}$, and $a_{j} a_{j+1}$ will all be equal to 0 . We did not count any term twice because $i-1<i<j$, so we would have three terms equal to 0 , which cannot happen because we can have only two. Thus, we can find at most one $n \in\{2,3, \ldots, 7\}$ such that $a_{n}=0$. We will do casework on which $n$ in this range have $a_{n}=0$.
If $n \in\{3,4,5,6\}$, then we know that the terms $a_{n-1} a_{n}=a_{n} a_{n+1}=0$, so all other terms must be 1 , so $a_{1} a_{2}=a_{2} a_{3}=\ldots=a_{n-2} a_{n-1}=1$ and $a_{n+1} a_{n+2}=\ldots=a_{7} a_{8}=1$. Because every $a_{i}$ appears in one of these equations for $i \neq n$, then we must have $a_{i}=1$ for all $i \neq n$, so we have 1 possibility for each choice of $n$ and thus 4 possibilities total for this case.
If $n=2$, then again we have $a_{1} a_{2}=a_{2} a_{3}=0$, so we must have $a_{3} a_{4}=a_{4} a_{5}=\ldots=a_{7} a_{8}=1$, so $a_{3}=a_{4}=\ldots=a_{8}=1$. However, this time $a_{1}$ is not fixed, and we see that regardless of our choice of $a_{1}$ the sum will still be equal to 5 . Thus, since there are 2 choices for $a_{1}$, then there are 2 possibilities total for this case. The case where $n=7$ is analogous, with $a_{8}$ having 2 possibilities, so we have another 2 possibilities.
Finally, if $a_{n}=1$ for $n \in\{2,3, \ldots, 7\}$, then we will have $a_{2} a_{3}=a_{3} a_{4}=\ldots=a_{6} a_{7}=1$. We already have five terms equal to 1 , so the remaining two terms $a_{1} a_{2}$ and $a_{7} a_{8}$ must be 0 . Since $a_{2}=1$, then we must have $a_{1}=0$, and since $a_{7}=1$ then $a_{8}=0$. Thus, there is only 1 possibility for this case.
Summing, we have $4+2+2+1=9$ total sequences.


problem: Triangle $A B C$ has $A B=5, B C=7$, and $C A=8$. New lines not containing but parallel to $A B$, $B C$, and $C A$ are drawn tangent to the incircle of $A B C$. What is the area of the hexagon formed by the sides of the original triangle and the newly drawn lines?

solution:
$\frac{31}{5} \sqrt{3}$
![](https://cdn.mathpix.com/cropped/2025_01_24_c57a655d574b5bfc73cdg-2.jpg?height=755&width=1006&top_left_y=243&top_left_x=603)

From the law of cosines we compute $\measuredangle A=\cos ^{-1}\left(\frac{5^{2}+8^{2}-7^{2}}{2(5)(8)}\right)=60^{\circ}$. Using brackets to denote the area of a region, we find that

$$
[A B C]=\frac{1}{2} A B \cdot A C \cdot \sin 60^{\circ}=10 \sqrt{3}
$$

The radius of the incircle can be computed by the formula

$$
r=\frac{2[A B C]}{A B+B C+C A}=\frac{20 \sqrt{3}}{20}=\sqrt{3}
$$

Now the height from $A$ to $B C$ is $\frac{2[A B C]}{B C}=\frac{20 \sqrt{3}}{7}$. Then the height from $A$ to $D E$ is $\frac{20 \sqrt{3}}{7}-2 r=\frac{6 \sqrt{3}}{7}$. Then $[A D E]=\left(\frac{6 \sqrt{3} / 7}{20 \sqrt{3} / 7}\right)^{2}[A B C]=\frac{9}{100}[A B C]$. Here, we use the fact that $\triangle A B C$ and $\triangle A D E$ are similar.
Similarly, we compute that the height from $B$ to $C A$ is $\frac{2[A B C]}{C A}=\frac{20 \sqrt{3}}{8}=\frac{5 \sqrt{3}}{2}$. Then the height from $B$ to $H J$ is $\frac{5 \sqrt{3}}{2}-2 r=\frac{\sqrt{3}}{2}$. Then $[B H J]=\left(\frac{\sqrt{3} / 2}{5 \sqrt{3} / 2}\right)^{2}[A B C]=\frac{1}{25}[A B C]$.
Finally, we compute that the height from $C$ to $A B$ is $\frac{2[A B C]}{5}=\frac{20 \sqrt{3}}{5}=4 \sqrt{3}$. Then the height from $C$ to $F G$ is $4 \sqrt{3}-2 r=2 \sqrt{3}$. Then $[C F G]=\left(\frac{2 \sqrt{3}}{4 \sqrt{3}}\right)^{2}[A B C]=\frac{1}{4}[A B C]$.
Finally we can compute the area of hexagon $D E F G H J$. We have

$$
\begin{gathered}
{[D E F G H J]=[A B C]-[A D E]-[B H J]-[C F G]=[A B C]\left(1-\frac{9}{100}-\frac{1}{25}-\frac{1}{4}\right)=[A B C]\left(\frac{31}{50}\right)=} \\
10 \sqrt{3}\left(\frac{31}{50}\right)=\frac{31}{5} \sqrt{3} .
\end{gathered}
$$


problem: An ant starts at the point $(1,0)$. Each minute, it walks from its current position to one of the four adjacent lattice points until it reaches a point $(x, y)$ with $|x|+|y| \geq 2$. What is the probability that the ant ends at the point $(1,1)$ ?

solution:
$\frac{7}{24}$ From the starting point of $(1,0)$, there is a $\frac{1}{4}$ chance we will go directly to $(1,1)$, a $\frac{1}{2}$ chance we will end at $(2,0)$ or $(1,-1)$, and a $\frac{1}{4}$ chance we will go to $(0,0)$. Thus, if $p$ is the probability that we will reach $(1,1)$ from $(0,0)$, then the desired probability is equal to $\frac{1}{4}+\frac{1}{4} p$, so we need only calculate $p$. Note that we can replace the condition $|x|+|y| \geq 2$ by $|x|+|y|=2$, since in each iteration the quantity $|x|+|y|$ can increase by at most 1 . Thus, we only have to consider the eight points $(2,0),(1,1),(0,2),(-1,1),(-2,0),(-1,-1),(0,-2),(1,-1)$. Let $p_{1}, p_{2}, \ldots, p_{8}$ be the probability of
reaching each of these points from $(0,0)$, respectively. By symmetry, we see that $p_{1}=p_{3}=p_{5}=p_{7}$ and $p_{2}=p_{4}=p_{6}=p_{8}$. We also know that there are two paths from $(0,0)$ to $(1,1)$ and one path from $(0,0)$ to $(2,0)$, thus $p_{2}=2 p_{1}$. Because the sum of all probabilities is 1 , we have $p_{1}+p_{2}+\ldots+p_{8}=1$. Combining these equations, we see that $4 p_{1}+4 p_{2}=12 p_{1}=1$, so $p_{1}=\frac{1}{12}$ and $p_{2}=\frac{1}{6}$. Since $p=p_{2}=\frac{1}{6}$, then the final answer is $\frac{1}{4}+\frac{1}{4} \cdot \frac{1}{6}=\frac{7}{24}$


problem: A polynomial $P$ is of the form $\pm x^{6} \pm x^{5} \pm x^{4} \pm x^{3} \pm x^{2} \pm x \pm 1$. Given that $P(2)=27$, what is $P(3)$ ?

solution:
439 We use the following lemma:
Lemma. The sign of $\pm 2^{n} \pm 2^{n-1} \pm \cdots \pm 2 \pm 1$ is the same as the sign of the $2^{n}$ term.
Proof. Without loss of generality, let $2^{n}$ be positive. (We can flip all signs.) Notice that $2^{n} \pm 2^{n-1} \pm$ $2^{n-2} \pm \cdots 2 \pm 1 \geq 2^{n}-2^{n-1}-2^{n-2}-\cdots-2-1=1$, which is positive.
We can use this lemma to uniquely determine the signs of $P$. Since our desired sum, 27, is positive, the coefficient of $x^{6}$ must be positive. Subtracting 64 , we now have that $\pm 2^{5} \pm 2^{4} \pm \ldots \pm 2 \pm 1=-37$, so the sign of $2^{5}$ must be negative. Continuing in this manner, we find that $P(x)=x^{6}-x^{5}-x^{4}+x^{3}+x^{2}-x+1$, so $P(3)=3^{6}-3^{5}-3^{4}+3^{3}+3^{2}-3+1=439$.


problem: What is the sum of the positive solutions to $2 x^{2}-x\lfloor x\rfloor=5$, where $\lfloor x\rfloor$ is the largest integer less than or equal to $x$ ?

solution:
$\frac{3+\sqrt{41}+2 \sqrt{11}}{4}$ We first note that $\lfloor x\rfloor \leq x$, so $2 x^{2}-x\lfloor x\rfloor \geq 2 x^{2}-x^{2}=x^{2}$. Since this function is increasing on the positive reals, all solutions must be at most $\sqrt{5}$. This gives us 3 possible values of $\lfloor x\rfloor: 0,1$, and 2 .
If $\lfloor x\rfloor=0$, then our equation becomes $2 x^{2}=5$, which has positive solution $x=\sqrt{\frac{5}{2}}$. This number is greater than 1 , so its floor is not 0 ; thus, there are no solutions in this case.
If $\lfloor x\rfloor=1$, then our equation becomes $2 x^{2}-x=5$. Using the quadratic formula, we find the positive solution $x=\frac{1+\sqrt{41}}{4}$. Since $3<\sqrt{41}<7$, this number is between 1 and 2 , so it satisfies the equation.
If $\lfloor x\rfloor=2$, then our equation becomes $2 x^{2}-2 x=5$. We find the positive solution $x=\frac{1+\sqrt{11}}{2}$. Since $3<\sqrt{11}<5$, this number is between 2 and 3 , so it satisfies the equation.
We then find that the sum of positive solutions is $\frac{1+\sqrt{41}}{4}+\frac{1+\sqrt{11}}{2}=\frac{3+\sqrt{41}+2 \sqrt{11}}{4}$.


problem: What is the remainder when $(1+x)^{2010}$ is divided by $1+x+x^{2}$ ?

solution:
1 We use polynomial congruence $\bmod 1+x+x^{2}$ to find the desired remainder. Since $x^{2}+x+1 \mid x^{3}-1$, we have that $x^{3} \equiv 1\left(\bmod 1+x+x^{2}\right)$. Now:

$$
\begin{aligned}
(1+x)^{2010} & \equiv\left(-x^{2}\right)^{2010} \quad\left(\bmod 1+x+x^{2}\right) \\
& \equiv x^{4020} \quad\left(\bmod 1+x+x^{2}\right) \\
& \equiv\left(x^{3}\right)^{1340} \quad\left(\bmod 1+x+x^{2}\right) \\
& \equiv 1^{1340} \quad\left(\bmod 1+x+x^{2}\right) \\
& \equiv 1 \quad\left(\bmod 1+x+x^{2}\right)
\end{aligned}
$$

Thus, the answer is 1 .


problem: Two circles with radius one are drawn in the coordinate plane, one with center $(0,1)$ and the other with center $(2, y)$, for some real number $y$ between 0 and 1 . A third circle is drawn so as to be tangent to both of the other two circles as well as the $x$ axis. What is the smallest possible radius for this third circle?

solution:
$3-2 \sqrt{2}$ Suppose that the smaller circle has radius $r$. Call the three circles (in order from left to right) $O_{1}, O_{2}$, and $O_{3}$. The distance between the centers of $O_{1}$ and $O_{2}$ is $1+r$, and the distance in their $y$-coordinates is $1-r$. Therefore, by the Pythagorean theorem, the difference in $x$-coordinates
is $\sqrt{(1+r)^{2}-(1-r)^{2}}=2 \sqrt{r}$, which means that $O_{2}$ has a center at $(2 \sqrt{r}, r)$. But $O_{2}$ is also tangent to $O_{3}$, which means that the difference in $x$-coordinate from the right-most point of $O_{2}$ to the center of $O_{3}$ is at most 1. Therefore, the center of $O_{3}$ has an $x$-coordinate of at most $2 \sqrt{r}+r+1$, meaning that $2 \sqrt{r}+r+1 \leq 2$. We can use the quadratic formula to see that this implies that $\sqrt{r} \leq \sqrt{2}-1$, so $r \leq 3-2 \sqrt{2}$. We can achieve equality by placing the center of $O_{3}$ at $(2, r)$ (which in this case is $(2,3-2 \sqrt{2}))$.


problem: What is the sum of all numbers between 0 and 511 inclusive that have an even number of 1 s when written in binary?

solution:
65408 Call a digit in the binary representation of a number a bit. We claim that for any given $i$ between 0 and 8 , there are 128 numbers with an even number of 1 s that have a 1 in the bit representing $2^{i}$. To prove this, we simply make that bit a 1 , then consider all possible configurations of the other bits, excluding the last bit (or the second-last bit if our given bit is already the last bit). The last bit will then be restricted to satisfy the parity condition on the number of 1 s . As there are 128 possible configurations of all the bits but two, we find 128 possible numbers, proving our claim.

Therefore, each bit is present as a 1 in 128 numbers in the sum, so the bit representing $2^{i}$ contributes $128 \cdot 2^{i}$ to our sum. Summing over all $0 \leq i \leq 8$, we find the answer to be $128(1+2+\ldots+128)=$ $128 \cdot 511=65408$.


problem: You are given two diameters $A B$ and $C D$ of circle $\Omega$ with radius 1. A circle is drawn in one of the smaller sectors formed such that it is tangent to $A B$ at $E$, tangent to $C D$ at $F$, and tangent to $\Omega$ at $P$. Lines $P E$ and $P F$ intersect $\Omega$ again at $X$ and $Y$. What is the length of $X Y$, given that $A C=\frac{2}{3}$ ?

solution:
\( \frac{4\sqrt{2}}{3} \). Let \( O \) denote the center of circle \( \Omega \). We first prove that \( OX \perp AB \) and \( OY \perp CD \). Consider the homothety about $P$ which maps the smaller circle to $\Omega$. This homothety takes $E$ to $X$ and also takes $A B$ to the line tangent to circle $\Omega$ parallel to $A B$. Therefore, $X$ is the midpoint of the arc $A B$, and so $O X \perp A B$. Similarly, $O Y \perp C D$.
Let $\theta=\angle A O C$. By the Law of Sines, we have $A C=2 \sin \frac{\theta}{2}$. Thus, $\sin \frac{\theta}{2}=\frac{1}{3}$, and $\cos \frac{\theta}{2}=\sqrt{1-\left(\frac{1}{3}\right)^{2}}=$ $\frac{2 \sqrt{2}}{3}$. Therefore,

$$
\begin{aligned}
X Y & =2 \sin \frac{\angle X O Y}{2} \\
& =2 \sin \left(90^{\circ}-\frac{\theta}{2}\right) \\
& =2 \cos \frac{\theta}{2} \\
& =\frac{4 \sqrt{2}}{3}
\end{aligned}
$$