exam: HMMT

solution: 12345679 Both $A$ and $B$ equal 12345679, so $\sqrt{A B}=12345679$ as well.

solution_match: Answer:


problem: Suppose that $x, y$, and $z$ are non-negative real numbers such that $x+y+z=1$. What is the maximum possible value of $x+y^{2}+z^{3}$ ?

solution: 1 Since $0 \leq y, z \leq 1$, we have $y^{2} \leq y$ and $z^{3} \leq z$. Therefore $x+y^{2}+z^{3} \leq x+y+z=1$. We can get $x+y^{2}+z^{3}=1$ by setting $(x, y, z)=(1,0,0)$.


problem: In a group of people, there are 13 who like apples, 9 who like blueberries, 15 who like cantaloupe, and 6 who like dates. (A person can like more than 1 kind of fruit.) Each person who likes blueberries also likes exactly one of apples and cantaloupe. Each person who likes cantaloupe also likes exactly one of blueberries and dates. Find the minimum possible number of people in the group.

solution:
22 Everyone who likes cantaloupe likes exactly one of blueberries and dates. However, there are 15 people who like cantaloupe, 9 who like blueberries, and 6 who like dates. Thus, everyone who likes blueberries or dates must also like cantaloupes (because if any of them didn't, we would end up with less than 15 people who like cantaloupe).
Since everyone who likes blueberries likes cantaloupes, none of them can like apples. However, the 6 people who like both cantaloupe and dates can also like apples. So, we could have a group where 7 people like apples alone, 9 like blueberries and cantaloupe, and 6 like apples, cantaloupe, and dates. This gives 22 people in the group, which is optimal.
$13^{\text {th }}$ ANNUAL HARVARD-MIT MATHEMATICS TOURNAMENT, 20 FEBRUARY 2010 - GUTS ROUND


problem:
To set up for a Fourth of July party, David is making a string of red, white, and blue balloons. He places them according to the following rules:

- No red balloon is adjacent to another red balloon.
- White balloons appear in groups of exactly two, and groups of white balloons are separated by at least two non-white balloons.
- Blue balloons appear in groups of exactly three, and groups of blue balloons are separated by at least three non-blue balloons.

If David uses over 600 balloons, determine the smallest number of red balloons that he can use.

solution:
99 It is possible to achieve 99 red balloons with the arrangement

$$
\text { WWBBBWW } \underbrace{\text { RBBBWWRBBBWW . . RBBBWW }}_{99 \text { RBBBWW's }},
$$

which contains $99 \cdot 6+7=601$ balloons.
Now assume that one can construct a chain with 98 or fewer red balloons. Then there can be 99 blocks of non-red balloons, which in total must contain more than 502 balloons. The only valid combinations of white and blue balloons are WWBBB, BBBWW, and WWBBBWW (Any others contain the subsequence BBBWWBBB , which is invalid). The sequence ... WWR must be followed by BBBWW; otherwise two groups of white balloons would be too close. Similarly, the sequence

RWW . . . must be preceded by WWBBB. It follows that WWBBBWW can be used at most once in a valid sequence, meaning that there can be at most $98 \cdot 5+7=497$ non-red balloons. Contradiction. Therefore the minimum is 99 red balloons. (Better if the party's outdoors; then we'd have 99 red balloons floating in the summer sky. :-p)


problem: You have a length of string and 7 beads in the 7 colors of the rainbow. You place the beads on the string as follows - you randomly pick a bead that you haven't used yet, then randomly add it to either the left end or the right end of the string. What is the probability that, at the end, the colors of the beads are the colors of the rainbow in order? (The string cannot be flipped, so the red bead must appear on the left side and the violet bead on the right side.)

solution: $\frac{1}{5040}$ The threading method does not depend on the colors of the beads, so at the end all configurations are equally likely. Since there are $7!=5040$ configurations in total, the probability of any particular configuration is $\frac{1}{5040}$.


problem: How many different numbers are obtainable from five 5 s by first concatenating some of the 5 s, then multiplying them together? For example, we could do $5 \cdot 55 \cdot 55,555 \cdot 55$, or 55555 , but not $5 \cdot 5$ or 2525 .

solution:
7 If we do 55555 , then we're done.
Note that $5,55,555$, and 5555 all have completely distinguishable prime factorizations. This means that if we are given a product of them, we can obtain the individual terms. The number of 5555's is the exponent of 101 , the number of 555 's is the exponent of 37 , the number of 55 's is the exponent of 11 minus the exponent of 101 , and the number of 5 's is just whatever we need to get the proper exponent of 5 . Then the answer is the number of ways we can split the five 5 's into groups of at least one. This is the number of unordered partitions of 5 , which is 7 .
$13^{\text {th }}$ ANNUAL HARVARD-MIT MATHEMATICS TOURNAMENT, 20 FEBRUARY 2010 - GUTS ROUND


problem:
What are the last 8 digits of

$$
11 \times 101 \times 1001 \times 10001 \times 100001 \times 1000001 \times 111 ?
$$

solution:
19754321 Multiply terms in a clever order.

$$
\begin{aligned}
11 \cdot 101 \cdot 10001 & =11,111,111 \\
111 \cdot 1001 \cdot 1000001 & =111,111,111,111
\end{aligned}
$$

The last eight digits of $11,111,111 \cdot 111,111,111,111$ are 87654321 . We then just need to compute the last 8 digits of $87654321 \cdot 100001=87654321+\ldots 32100000$, which are 19754321 .


problem:
Each square in the following hexomino has side length 1. Find the minimum area of any rectangle that contains the entire hexomino.
![](https://cdn.mathpix.com/cropped/2025_01_24_f63473fe57314fe1b376g-02.jpg?height=247&width=321&top_left_y=2045&top_left_x=943)

solution:
$\frac{21}{2}$ If a rectangle contains the entire hexomino, it must also contain its convex hull, which is an origin-symmetric hexagon. It is fairly clear that the smallest rectangle that contains such a hexagon must share one set of parallel sides with the hexagon. There are three such rectangles, and checking them all, we find that the one shown below is the smallest. It has area $\frac{21}{2}$.
![](https://cdn.mathpix.com/cropped/2025_01_24_f63473fe57314fe1b376g-03.jpg?height=505&width=510&top_left_y=235&top_left_x=848)


problem: Indecisive Andy starts out at the midpoint of the 1-unit-long segment $\overline{H T}$. He flips 2010 coins. On each flip, if the coin is heads, he moves halfway towards endpoint $H$, and if the coin is tails, he moves halfway towards endpoint $T$. After his 2010 moves, what is the expected distance between Andy and the midpoint of $\overline{H T}$ ?

solution:
| $\frac{1}{4}$ |
| :---: |
| Let Andy's position be $x$ units from the H end after 2009 flips. If Any moves towards | the $H$ end, he ends up at $\frac{x}{2}$, a distance of $\frac{1-x}{2}$ from the midpoint. If Andy moves towards the $T$ end, he ends up at $\frac{1+x}{2}$, a distance of $\frac{x}{2}$ from the midpoint. His expected distance from the midpoint is then

$$
\frac{\frac{1-x}{2}+\frac{x}{2}}{2}=\frac{1}{4} .
$$

Since this does not depend on $x, \frac{1}{4}$ is the answer.
$13^{\text {th }}$ ANNUAL HARVARD-MIT MATHEMATICS TOURNAMENT, 20 FEBRUARY 2010 — GUTS ROUND


problem: Let $A B C$ be a triangle with $A B=8, B C=15$, and $A C=17$. Point $X$ is chosen at random on line segment $A B$. Point $Y$ is chosen at random on line segment $B C$. Point $Z$ is chosen at random on line segment $C A$. What is the expected area of triangle $X Y Z$ ?

solution:
15 Let $\mathbb{E}(X)$ denote the expected value of $X$, and let $[S]$ denote the area of $S$. Then

$$
\begin{aligned}
\mathbb{E}([\triangle X Y Z]) & =\mathbb{E}([\triangle A B C]-[\triangle X Y B]-[\triangle Z Y C]-[\triangle X B Z]) \\
& =[\triangle A B C]-\mathbb{E}([\triangle X Y B])-\mathbb{E}([\triangle Z Y C])-[\triangle X B Z])
\end{aligned}
$$

where the last step follows from linearity of expectation ${ }^{1}$. But $[\triangle X Y B]=\frac{1}{2} \cdot B X \cdot B Y \cdot \sin (B)$. The $\frac{1}{2} \sin (B)$ term is constant, and $B X$ and $B Y$ are both independent with expected values $\frac{A B}{2}$ and $\frac{B C}{2}$, respectively. Thus $\mathbb{E}([\triangle X Y B])=\frac{1}{8} A B \cdot B C \cdot \sin (B)=\frac{1}{4}[\triangle A B C]$. Similarly, $\mathbb{E}([\triangle Z Y C])=$ $\mathbb{E}([\triangle Z B X])=\frac{1}{4}[\triangle A B C]$.
Then we have $\mathbb{E}([\triangle X Y Z])=\left(1-\frac{1}{4}-\frac{1}{4}-\frac{1}{4}\right)[\triangle A B C]=\frac{1}{4}[\triangle A B C]=15$.
Note: We can also solve this problem (and the more general case of polygons) by noting that the area of $X Y Z$ is linear in the coordinates of $X, Y$, and $Z$, so the expected area of $X Y Z$ is the same as the area of $X^{\prime} Y^{\prime} Z^{\prime}$, where $X^{\prime}$ is the expected location of $X, Y^{\prime}$ is the expected location of $Y$, and $Z^{\prime}$ is the expected location of $Z$. In our case, this corresponds to the midpoints of the three sides $A B$, $B C$, and $C A$.


problem: From the point $(x, y)$, a legal move is a move to $\left(\frac{x}{3}+u, \frac{y}{3}+v\right)$, where $u$ and $v$ are real numbers such that $u^{2}+v^{2} \leq 1$. What is the area of the set of points that can be reached from $(0,0)$ in a finite number of legal moves?

solution:
| $\frac{9 \pi}{4}$ |
| :---: |
| We claim that the set of points is the disc with radius $\frac{3}{2}$ centered at the origin, which | clearly has area $\frac{9 \pi}{4}$.

First, we show that the set is contained in this disc. This is because if we are currently at a distance of $r$ from the origin, then we can't end up at a distance of greater than $\frac{r}{3}+1$ from the origin after a single move. Since $\frac{r}{3}+1<\frac{3}{2}$ if $r<\frac{3}{2}$, we will always end up in the disc of radius $\frac{3}{2}$ if we start in it. Since the origin is inside this disc, any finite number of moves will leave us inside this disc.

Next, we show that all points in this disc can be reached in a finite number of moves. Indeed, after one move we can get all points within a distance of 1 . After two moves, we can get all points within a distance of $\frac{4}{3}$. After three moves, we can get all points within a distance of $\frac{13}{9}$. In general, after $n$ moves we can get all points within a distance of $\frac{3}{2}-\frac{1}{2 \cdot 3^{k-1}}$. This means that for any distance $d<\frac{3}{2}$, we will eventually get all points within a distance of $d$, so all points in the disc of radius $\frac{3}{2}$ can be reached after some number of moves.


problem: How many different collections of 9 letters are there? A letter can appear multiple times in a collection. Two collections are equal if each letter appears the same number of times in both collections.

solution:
$\left.\begin{array}{c}34 \\ 9\end{array}\right)$ We put these collections in bijections with binary strings of length 34 containing 9 zeroes and 25 ones. Take any such string - the 9 zeroes will correspond to the 9 letters in the collection. If there are $n$ ones before a zero, then that zero corresponds to the $(n+1)$ st letter of the alphabet. This scheme is an injective map from the binary strings to the collections, and it has an inverse, so the number of collections is $\binom{34}{9}$.
$13^{\text {th }}$ ANNUAL HARVARD-MIT MATHEMATICS TOURNAMENT, 20 FEBRUARY 2010 - GUTS ROUND


problem: A triangle in the $x y$-plane is such that when projected onto the $x$-axis, $y$-axis, and the line $y=x$, the results are line segments whose endpoints are $(1,0)$ and $(5,0),(0,8)$ and $(0,13)$, and $(5,5)$ and $(7.5,7.5)$, respectively. What is the triangle's area?

solution: $\frac{17}{2}$ Sketch the lines $x=1, x=5, y=8, y=13, y=10-x$, and $y=15-x$. The triangle has to be contained in the hexagonal region contained in all these lines. If all the projections are correct, every other vertex of the hexagon must be a vertex of the triangle, which gives us two possibilities for the triangle. One of these triangles has vertices at $(2,8),(1,13)$, and $(5,10)$, and has an area of $\frac{17}{2}$. It is easy to check that the other triangle has the same area, so the answer is unique.


problem: In how many ways can you fill a $3 \times 3$ table with the numbers 1 through 9 (each used once) such that all pairs of adjacent numbers (sharing one side) are relatively prime?

solution:
2016 The numbers can be separated into four sets. Numbers in the set $A=\{1,5,7\}$ can be placed next to anything. The next two sets are $B=\{2,4,8\}$ and $C=\{3,9\}$. The number 6 , which forms the final set $D$, can only be placed next to elements of $A$. The elements of each group can be interchanged without violating the condition, so without loss of generality, we can pretend we have three 1 's, three 2's, two 3 's, and one 6 , as long as we multiply our answer by $3!3!2$ ! at the end. The available arrangements are, grouped by the position of the 6 , are:
When 6 is in contact with three numbers:

| 1 | 2 | 3 |
| :--- | :--- | :--- |
| 6 | 1 | 2 |
| 1 | 2 | 3 |

When 6 is in contact with two numbers:

| 6 | 1 | 2 |  |  |  |
| :--- | :--- | :--- | :--- | :--- | :--- |
| 1 | 2 | 3 | 6 1 2
 1 1 3
 2 3 1 | 2 | 3 |

The next two can be flipped diagonally to create different arrangements:

| 6 | 1 | 2 |  |  |  |
| :--- | :--- | :--- | :--- | :--- | :--- |
| 1 | 2 | 3 | 6 1 | 2 |  |
| 1 | 2 | 3 |  |  |  |
| 1 | 3 | 2 | 3 | 1 | 2 |

Those seven arrangements can be rotated 90, 180, and 270 degrees about the center to generate a total of 28 arrangements. $28 \cdot 3!3!2!=2016$.


problem: Pick a random integer between 0 and 4095, inclusive. Write it in base 2 (without any leading zeroes). What is the expected number of consecutive digits that are not the same (that is, the expected number of occurrences of either 01 or 10 in the base 2 representation)?

solution:
$\frac{20481}{4096}$ Note that every number in the range can be written as a 12-digit binary string. For $i=1,2, \ldots 11$, let $R_{i}$ be a random variable which is 1 if the $i$ th and $(i+1)$ st digits differ in a randomly chosen number in the range. By linearity of expectation, $E\left(\sum_{i} R_{i}\right)=\sum E\left(R_{i}\right)$.
Since we choose every binary string of length 12 with equal probability, the sum of the expectations is $\frac{11}{2}$. However, this is not the expected number of 01 s and $10 s$ - we need to subtract the occasions where the leading digit is zero. There is a $\frac{1}{2}$ chance that the number starts with a 0 , in which case we must ignore the first digit change - unless the number was 0 , in which case there are no digit changes. Therefore, our answer is $\frac{11}{2}-\frac{1}{2}+\frac{1}{4096}=\frac{20481}{4096}$.
$13^{\text {th }}$ ANNUAL HARVARD-MIT MATHEMATICS TOURNAMENT, 20 FEBRUARY 2010 - GUTS ROUND


problem: Jessica has three marbles colored red, green, and blue. She randomly selects a non-empty subset of them (such that each subset is equally likely) and puts them in a bag. You then draw three marbles from the bag with replacement. The colors you see are red, blue, red. What is the probability that the only marbles in the bag are red and blue?

solution:
| $\frac{27}{35}$ |
| :---: |
| There are two possible sets of marbles in the bag, $\{$ red,blue\} and \{red,blue,green\}. | Initially, both these sets are equally likely to be in the bag. However, the probability of red, blue, red being drawn from a set $S$ of marbles is proportional to $|S|^{-3}$, as long as red and blue are both in $S$. By Bayes's Rule, we must weight the probability of these two sets by $|S|^{-3}$. The answer is $\frac{(1 / 2)^{3}}{(1 / 2)^{3}+(1 / 3)^{3}}$.


problem: An ant starts at the origin, facing in the positive $x$-direction. Each second, it moves 1 unit forward, then turns counterclockwise by $\sin ^{-1}\left(\frac{3}{5}\right)$ degrees. What is the least upper bound on the distance between the ant and the origin? (The least upper bound is the smallest real number $r$ that is at least as big as every distance that the ant ever is from the origin.)

solution:
$\sqrt{10}$ We claim that the points the ant visits lie on a circle of radius $\frac{\sqrt{10}}{2}$. We show this by saying that the ant stays a constant distance $\frac{\sqrt{10}}{2}$ from the point $\left(\frac{1}{2}, \frac{3}{2}\right)$.
Suppose the ant moves on a plane $P$. Consider a transformation of the plane $P^{\prime}$ such that after the first move, the ant is at the origin of $P^{\prime}$ and facing in the direction of the $x^{\prime}$ axis (on $P^{\prime}$ ). The transformation to get from $P$ to $P^{\prime}$ can be gotten by rotating $P$ about the origin counterclockwise through an angle $\sin ^{-1}\left(\frac{3}{5}\right)$ and then translating it 1 unit to the right. Observe that the point $\left(\frac{1}{2}, \frac{3}{2}\right)$ is fixed under this transformation, which can be shown through the expression $\left(\frac{1}{2}+\frac{3}{2} i\right)\left(\frac{4}{5}+\frac{3}{5} i\right)+1=\frac{1}{2}+\frac{3}{2} i$. It follows that at every point the ant stops, it will always be the same distance from $\left(\frac{1}{2}, \frac{3}{2}\right)$. Since it starts at $(0,0)$, this fixed distance is $\frac{\sqrt{10}}{2}$.
![](https://cdn.mathpix.com/cropped/2025_01_24_f63473fe57314fe1b376g-06.jpg?height=438&width=538&top_left_y=231&top_left_x=834)

Since $\sin ^{-1}\left(\frac{3}{5}\right)$ is not a rational multiple of $\pi$, the points the ant stops at form a dense subset of the circle in question. As a result, the least upper bound on the distance between the ant and the origin is the diameter of the circle, which is $\sqrt{10}$.


problem: Find two lines of symmetry of the graph of the function $y=x+\frac{1}{x}$. Express your answer as two equations of the form $y=a x+b$.

solution:
$y=(1+\sqrt{2}) x$ and $y=(1-\sqrt{2}) x$ The graph of the function $y=x+\frac{1}{x}$ is a hyperbola. We can see this more clearly by writing it out in the standard form $x^{2}-x y+1=0$ or $\left(\frac{y}{2}\right)^{2}-\left(x-\frac{1}{2} y\right)^{2}=1$. The hyperbola has asymptotes given by $x=0$ and $y=x$, so the lines of symmetry will be the (interior and exterior) angle bisectors of these two lines. This means that they will be $y=\tan \left(67.5^{\circ}\right) x$ and $y=-\cot \left(67.5^{\circ}\right) x$, which, using the tangent half-angle formula $\tan \left(\frac{x}{2}\right)=\sqrt{\frac{1+\cos (x)}{1-\cos (x)}}$, gives the two lines $y=(1+\sqrt{2}) x$ and $y=(1-\sqrt{2}) x$.
$13^{\text {th }}$ ANNUAL HARVARD-MIT MATHEMATICS TOURNAMENT, 20 FEBRUARY 2010 - GUTS ROUND


problem: A 5-dimensional ant starts at one vertex of a 5 -dimensional hypercube of side length 1 . A move is when the ant travels from one vertex to another vertex at a distance of $\sqrt{2}$ away. How many ways can the ant make 5 moves and end up on the same vertex it started at?

solution:
6240 We let the cube lie in $\mathbb{R}^{5}$ with each corner with coordinates 1 or 0 . Assume the ant starts at $(0,0,0,0,0)$. Every move the ant adds or subtracts 1 to two of the places. Note that this means the ant can only land on a vertex with the sum of its coordinates an even number. Every move the ant has $\binom{5}{2}=10$ choices.
From any vertex there are 10 two-move sequences that put the ant at the same vertex it started at.
There are 6 two-move sequences to move from one vertex to a different, chosen vertex. If your chosen vertex differs from your current vertex by 2 of the 5 coordinates, your first move corrects for one of these two. There are 2 ways to choose which coordinate to correct for on the first move, and there are 3 ways to choose the second coordinate you change, yielding 6 sequences. If your chosen vertex differs from your current vertex by 4 of the 5 coordinates, each move corrects for two of these four. This yields $\binom{4}{2}=6$ sequences.
Finally, there are 60 three-move sequences that put the ant at the same vertex it started at. There are 10 ways to choose the first move, and there are 6 ways to make two moves to return to your original position.
The motion of the ant can be split into two cases.
Case 1: After the 3rd move the ant is on the vertex it started at. There are $(60)(10)=600$ different possible paths.
Case 2: After the third move the ant is on a vertex different from the one it started on. There are $\left(10^{3}-60\right)(6)=(940)(6)=5640$ different possible paths.
So there are 6240 total possible paths.


problem:
Find the volume of the set of points $(x, y, z)$ satisfying

$$
\begin{aligned}
x, y, z & \geq 0 \\
x+y & \leq 1 \\
y+z & \leq 1 \\
z+x & \leq 1
\end{aligned}
$$

solution:
$\frac{1}{4}$ Without loss of generality, assume that $x \geq y$ - half the volume of the solid is on this side of the plane $x=y$. For each value of $c$ from 0 to $\frac{1}{2}$, the region of the intersection of this half of the solid with the plane $y=c$ is a trapezoid. The trapezoid has height $1-2 c$ and average base $\frac{1}{2}$, so it has an area of $\frac{1}{2}-c$.
The total volume of this region is $\frac{1}{2}$ times the average area of the trapezoids, which is $\frac{1}{2} \cdot \frac{1}{4}=\frac{1}{8}$. Double that to get the total volume, which is $\frac{1}{4}$.


problem: Let $\triangle A B C$ be a scalene triangle. Let $h_{a}$ be the locus of points $P$ such that $|P B-P C|=|A B-A C|$. Let $h_{b}$ be the locus of points $P$ such that $|P C-P A|=|B C-B A|$. Let $h_{c}$ be the locus of points $P$ such that $|P A-P B|=|C A-C B|$. In how many points do all of $h_{a}, h_{b}$, and $h_{c}$ concur?

solution:
2 The idea is similar to the proof that the angle bisectors concur or that the perpendicular bisectors concur. Assume WLOG that $B C>A B>C A$. Note that $h_{a}$ and $h_{b}$ are both hyperbolas. Therefore, $h_{a}$ and $h_{b}$ intersect in four points (each branch of $h_{a}$ intersects exactly once with each branch of $h_{b}$ ). Note that the branches of $h_{a}$ correspond to the cases when $P B>P C$ and when $P B<P C$. Similarly, the branches of $h_{b}$ correspond to the cases when $P C>P A$ and $P C<P A$.

If either $P A<P B<P C$ or $P C<P B<P A$ (which each happens for exactly one point of intersection of $h_{a}$ and $h_{b}$ ), then $|P C-P A|=|P C-P B|+|P B-P A|=|A B-A C|+|B C-B A|=|B C-A C|$, and so $P$ also lies on $h_{c}$. So, exactly two of the four points of intersection of $h_{a}$ and $h_{b}$ lie on $h_{c}$, meaning that $h_{a}, h_{b}$, and $h_{c}$ concur in four points.
$13^{\text {th }}$ ANNUAL HARVARD-MIT MATHEMATICS TOURNAMENT, 20 FEBRUARY 2010 - GUTS ROUND


problem: You are the general of an army. You and the opposing general both have an equal number of troops to distribute among three battlefields. Whoever has more troops on a battlefield always wins (you win ties). An order is an ordered triple of non-negative real numbers $(x, y, z)$ such that $x+y+z=1$, and corresponds to sending a fraction $x$ of the troops to the first field, $y$ to the second, and $z$ to the third. Suppose that you give the order $\left(\frac{1}{4}, \frac{1}{4}, \frac{1}{2}\right)$ and that the other general issues an order chosen uniformly at random from all possible orders. What is the probability that you win two out of the three battles?

solution:
| $\frac{5}{8}$ |
| :---: |
| Let $x$ | be the portion of soldiers the opposing general sends to the first battlefield, and $y$ the portion he sends to the second. Then $1-x-y$ is the portion he sends to the third. Then $x \geq 0$, $y \geq 0$, and $x+y \leq 1$. Furthermore, you win if one of the three conditions is satisfied: $x \leq \frac{1}{4}$ and $y \leq \frac{1}{4}, x \leq \frac{1}{4}$ and $1-x-y \leq \frac{1}{2}$, or $y \leq \frac{1}{4}$ and $1-x-y \leq \frac{1}{2}$. This is illustrated in the picture below.

![](https://cdn.mathpix.com/cropped/2025_01_24_f63473fe57314fe1b376g-07.jpg?height=415&width=422&top_left_y=2080&top_left_x=884)

Guts Round

This triangle is a linear projection of the region of feasible orders, so it preserves area and probability ratios. The probability that you win, then is given by the portion of the triangle that satisfies one of the three above constraints - in other words, the area of the shaded region divided by the area of the entire triangle. We can easily calculate this to be $\frac{\frac{5}{16}}{\frac{1}{2}}=\frac{5}{8}$.


problem: In the country of Francisca, there are 2010 cities, some of which are connected by roads. Between any two cities, there is a unique path which runs along the roads and which does not pass through any city twice. What is the maximum possible number of cities in Francisca which have at least 3 roads running out of them?

solution:
1004 The restrictions on how roads connect cities directly imply that the graph of the cities of Francisca with the roads as edges is a tree. Therefore the sum of the degrees of all the vertices is $2009 \cdot 2=4018$. Suppose that $b$ vertices have degree $\geq 3$. The other $2010-b$ vertices must have a degree of at least 1 , so $3 b+(2010-b) \leq 4018$ or $2 b \leq 2008$. So $b$ is at most 1004 . We can achieve $b=1004$ with the following graph:
![](https://cdn.mathpix.com/cropped/2025_01_24_f63473fe57314fe1b376g-08.jpg?height=91&width=514&top_left_y=887&top_left_x=849)


problem: Define a sequence of polynomials as follows: let $a_{1}=3 x^{2}-x$, let $a_{2}=3 x^{2}-7 x+3$, and for $n \geq 1$, let $a_{n+2}=\frac{5}{2} a_{n+1}-a_{n}$. As $n$ tends to infinity, what is the limit of the sum of the roots of $a_{n}$ ?

solution:
$\frac{13}{3}$ By using standard methods for solving linear recurrences ${ }^{2}$, we see that this recurrence has a characteristic polynomial of $x^{2}-\frac{5}{2} x+1=\left(x-\frac{1}{2}\right)(x-2)$, hence $a_{n}(x)=c(x) \cdot 2^{n}+d(x) \cdot 2^{-n}$ for some polynomials $c$ and $d$. Plugging in $n=1$ and $n=2$ gives

$$
2 c(x)+\frac{1}{2} d(x)=3 x^{2}-x
$$

and

$$
4 c(x)+\frac{1}{4} d(x)=3 x^{2}-7 x+3
$$

Subtracting the first equation from two times the second equation gives $6 c(x)=3 x^{2}-13 x+6$, so $c(x)=\frac{3 x^{2}-13 x+6}{6}$. As $n$ grows large, the $c(x) 2^{n}$ term dominates compared to the $d(x) 2^{-n}$ term, so the roots of $a_{n}(x)$ converge to the roots of $c(x)$. Thus the roots of $a_{n}(x)$ converge to the roots of $3 x^{2}-13 x+6$, which by Vieta's formula ${ }^{3}$ have a sum of $\frac{13}{3}$.


problem: How many functions $f:\{1,2,3,4,5\} \rightarrow\{1,2,3,4,5\}$ have the property that $f(\{1,2,3\})$ and $f(f(\{1,2,3\}))$ are disjoint?

solution:
94 Let $f(\{1,2,3\})$ be $A$. Then $A \cap f(A)=\emptyset$, so $A$ must be a subset of $\{4,5\}$. If $B=\{4,5\}$, there are $2^{3}-2$ ways to assign each element in $\{1,2,3\}$ to a value in $\{4,5\}$, and 9 ways to assign each element of $\{4,5\}$ to a value in $\{1,2,3\}$, for a total of 54 choices of $f$. If $A=\{4\}$, there is 1 possible value for each element of $\{1,2,3\}, 4$ ways to assign $\{4\}$ with a value from $\{1,2,3,5\}$, and 5 ways to assign a value to $\{5\}$. Similarly, if $A=\{5\}$, there are $4 \cdot 5=20$ choices for $f$. In total, there are $54+20 \cdot 2=94$ possible functions.

[^1]26. [15] Express the following in closed form, as a function of $x$ :
$\sin ^{2}(x)+\sin ^{2}(2 x) \cos ^{2}(x)+\sin ^{2}(4 x) \cos ^{2}(2 x) \cos ^{2}(x)+\cdots+\sin ^{2}\left(2^{2010} x\right) \cos ^{2}\left(2^{2009} x\right) \cdots \cos ^{2}(2 x) \cos ^{2}(x)$.


solution:
$1-\frac{\sin ^{2}\left(2^{2011} x\right)}{4^{2011} \sin ^{2}(x)}$ Note that
\[

$$
\begin{aligned}
& \sin ^{2}(x)+\sin ^{2}(2 x) \cos ^{2}(x)+\cdots+\sin ^{2}\left(2^{2010} x\right) \cos ^{2}\left(2^{2009} x\right) \cdots \cos ^{2}(2 x) \cos ^{2}(x) \\
& \quad=\left(1-\cos ^{2}(x)\right)+\left(1-\cos ^{2}(2 x)\right) \cos ^{2}(x)+\cdots+\left(1-\cos ^{2}\left(2^{2010} x\right)\right) \cos ^{2}\left(2^{2009} x\right) \cdots \cos ^{2}(x)
\end{aligned}
$$
\]

which telescopes to $1-\cos ^{2}(x) \cos ^{2}(2 x) \cos ^{2}(4 x) \cdots \cos ^{2}\left(2^{2010} x\right)$. To evaluate $\cos ^{2}(x) \cos ^{2}(2 x) \cdots \cos ^{2}\left(2^{2010} x\right)$, multiply and divide by $\sin ^{2}(x)$. We then get

$$
1-\frac{\sin ^{2}(x) \cos ^{2}(x) \cos ^{2}(2 x) \cdots \cos ^{2}\left(2^{2010} x\right)}{\sin ^{2}(x)}
$$

Using the double-angle formula for sin, we get that $\sin ^{2}(y) \cos ^{2}(y)=\frac{\sin ^{2}(2 y)}{4}$. Applying this 2011 times makes the above expression

$$
1-\frac{\sin ^{2}\left(2^{2011} x\right)}{4^{2011} \sin ^{2}(x)}
$$

which is in closed form.


problem:
Suppose that there are real numbers $a, b, c \geq 1$ and that there are positive reals $x, y, z$ such that

$$
\begin{aligned}
a^{x}+b^{y}+c^{z} & =4 \\
x a^{x}+y b^{y}+z c^{z} & =6 \\
x^{2} a^{x}+y^{2} b^{y}+z^{2} c^{z} & =9
\end{aligned}
$$

What is the maximum possible value of $c$ ?

solution:
$\sqrt[3]{4}$ The Cauchy-Schwarz inequality states that given 2 sequences of $n$ real numbers $x_{1}, x_{2}, \ldots, x_{n}$ and $y_{1}, y_{2}, \ldots, y_{n}$, then $\left(x_{1}^{2}+x_{2}^{2}+\ldots+x_{n}^{2}\right)\left(y_{1}^{2}+y_{2}^{2}+\ldots+y_{n}^{2}\right) \geq\left(x_{1} y_{1}+x_{2} y_{2}+\ldots+x_{n} y_{n}\right)^{2}$ with equality holding if and only if $\frac{x_{1}}{y_{1}}=\frac{x_{2}}{y_{2}}=\ldots=\frac{x_{n}}{y_{n}}$. Applying this to $\left\{a^{x / 2}, b^{y / 2}, c^{z / 2}\right\}$ and $\left\{x a^{x / 2}, y b^{y / 2}, z c^{z / 2}\right\}$ yields $\left(a^{x}+b^{y}+c^{z}\right)\left(x^{2} a^{x}+y^{2} b^{y}+z^{2} c^{z}\right) \geq\left(x a^{x}+y b^{y}+z b^{z}\right)^{2}$ with equality holding if and only if $x=y=z$.
However, equality does hold (both sides evaluate to 36 ), so $x=y=z$. The second equation then becomes $x\left(a^{x}+b^{x}+c^{x}\right)=6$, which implies $x=\frac{3}{2}$. Then we have $a^{3 / 2}+b^{3 / 2}+c^{3 / 2}=4$. To maximize $c$, we minimize $a$ and $b$ by setting $a=b=1$. Then $c^{3 / 2}=2$ or $c=\sqrt[3]{4}$.
$13^{\text {th }}$ ANNUAL HARVARD-MIT MATHEMATICS TOURNAMENT, 20 FEBRUARY 2010 - GUTS ROUND


problem: Danielle Bellatrix Robinson is organizing a poker tournament with 9 people. The tournament will have 4 rounds, and in each round the 9 players are split into 3 groups of 3 . During the tournament, each player plays every other player exactly once. How many different ways can Danielle divide the 9 people into three groups in each round to satisfy these requirements?

solution:
20160 We first split the 9 people up arbitrarily into groups of 3 . There are $\frac{\binom{9}{3}\binom{6}{3}\binom{3}{3}}{3!}=280$ ways of doing this. Without loss of generality, label the people 1 through 9 so that the first round groups are $\{1,2,3\},\{4,5,6\}$, and $\{7,8,9\}$. We will use this numbering to count the number of ways DBR can divide the 9 players in rounds 2,3 , and 4 .

In round 2 , because players 1,2 , and 3 are together in the first round, they must be in separate groups, and likewise for $\{4,5,6\}$ and $\{7,8,9\}$. Disregarding ordering of the three groups in a single round, we will first place 1,2 , and 3 into their groups, then count the number of ways to place $\{4,5,6\}$ and $\{7,8,9\}$ in the groups with them. We do this by placing one member from each of $\{4,5,6\}$ and $\{7,8,9\}$ into each group. There are $(3!)^{2}$ ways to do this. Now, because of symmetry, we can use the round 2 grouping $\{1,4,7\},\{2,5,8\},\{3,6,9\}$ to list out the remaining possibilities for round 3 and 4 groupings.
Casework shows that there are 2 ways to group the players in the remaining two rounds. We multiply $280 \cdot(3!)^{2} \cdot 2$ to get 20160.


problem:
Compute the remainder when

$$
\sum_{k=1}^{30303} k^{k}
$$

is divided by 101 .

solution:
29 The main idea is the following lemma:
Lemma. For any non-negative integer $n$ and prime $p, \sum_{k=n+1}^{n+p^{2}-p} k^{k} \equiv 1(\bmod p)$.
Proof. Note that $a^{b}$ depends only on the value of $a(\bmod p)$ and the value of $b(\bmod p-1)$. Since $p$ and $p-1$ are relatively prime, the Chinese Remainder Theorem ${ }^{4}$ implies that any $p^{2}-p$ consecutive integers will take on each possible pair of a residue $\bmod p$ and a residue $\bmod p-1$. In other words, if we let $(a, b)=(k(\bmod p), k(\bmod p-1))$, then as $k$ ranges through $p^{2}-p$ consecutive integers, $(a, b)$ will range through all $p^{2}-p$ ordered pairs of residues $\bmod p$ and residues mod $p-1$. This implies that

$$
\sum_{k=n+1}^{n+p^{2}-p} k^{k} \equiv \sum_{b=1}^{p-1} \sum_{a=1}^{p} a^{b} .
$$

It is well-known that $\sum_{a=1}^{p} a^{b}=\left\{\begin{array}{rl}-1 & p-1 \mid b \\ 0 & p-1 \nmid b\end{array}\right.$. We will sketch a proof here. When $p-1 \mid b$, the result follows from Fermat's Little Theorem ${ }^{5}$. When $p-1 \nmid b$, it suffices to consider the case when $b \mid p-1$, since the $b$ th powers $\bmod p$ are the same as the $\operatorname{gcd}(b, p-1)$ th powers $\bmod p$, and there are an equal number of every non-zero $b$ th power. But in this case, the $b$ th powers are just the solutions to $x^{\frac{p-1}{b}}-1$, which add up to zero by Vieta's formulas.
Now, using the formula for $\sum a^{b}$, we get that

$$
\sum_{b=1}^{p-1} \sum_{a=1}^{p} a^{b} \equiv-1 \quad(\bmod p)
$$

which completes the lemma.
We now apply the lemma with $p=101$ and $n=3,10103$, and 20103 to get that $\sum_{k=1}^{30303} k^{k} \equiv$ $\left(\sum_{k=1}^{3} k^{k}\right)-3$. But $\sum_{k=1}^{3} k^{k}=1^{1}+2^{2}+3^{3}=1+4+27=32$, so the answer is $32-3=29$.


problem:
A monomial term $x_{i_{1}} x_{i_{2}} \ldots x_{i_{k}}$ in the variables $x_{1}, x_{2}, \ldots x_{8}$ is square-free if $i_{1}, i_{2}, \ldots i_{k}$ are distinct. (A constant term such as 1 is considered square-free.) What is the sum of the coefficients of the squarefree terms in the following product?

$$
\prod_{1 \leq i<j \leq 8}\left(1+x_{i} x_{j}\right)
$$

solution:
764 Let $a_{n}$ be the sum of the coefficients of the square-terms in the product $\prod_{1 \leq i<j \leq n}(1+$ $x_{i} x_{j}$ ). Square-free terms in this product come in two types: either they include $x_{n}$, or they do not. The sum of the coefficients of the terms that include $x_{n}$ is $(n-1) a_{n-2}$, since we can choose any of the $n-1$ other variables to be paired with $x_{n}$, and then choose any square-free term from the product taken over the other $n-2$ variables. The sum of the coefficients of the terms that do not include $x_{n}$ are $a_{n-1}$, because they all come from the product over the other $n-1$ variables. Therefore, $a_{n}=a_{n-1}+(n-1) a_{n-2}$.
We use this recursion to find $a_{8}$. As base cases, $a_{0}$ and $a_{1}$ are both 1 . Then $a_{2}=2, a_{3}=4, a_{4}=10$, $a_{5}=26, a_{6}=76, a_{7}=232$, and finally, $a_{8}=764$.
$13^{\text {th }}$ ANNUAL HARVARD-MIT MATHEMATICS TOURNAMENT, 20 FEBRUARY 2010 - GUTS ROUND


problem: In the Democratic Republic of Irun, 5 people are voting in an election among 5 candidates. If each person votes for a single candidate at random, what is the expected number of candidates that will be voted for?

solution:
| $\frac{2101}{625}$ |
| :---: |
| The probability that a chosen candidate will receive no votes at all is $\left(\frac{4}{5}\right)^{5}$, or the | probability that every person will vote for someone other than that one candidate. Then the probability that a chosen candidate will receive at least one vote is $1-\left(\frac{4}{5}\right)^{5}=\frac{2101}{3125}$. By linearity of expectations, the final answer is this probability times the number of candidates, or $5 \cdot \frac{2101}{3125}=\frac{2101}{625}$.


problem: There are 101 people participating in a Secret Santa gift exchange. As usual each person is randomly assigned another person for whom (s)he has to get a gift, such that each person gives and receives exactly one gift and no one gives a gift to themself. What is the probability that the first person neither gives gifts to or receives gifts from the second or third person? Express your answer as a decimal rounded to five decimal places.

solution:
0.96039 Let $D_{k}$ denote the number of derangements of $\{1,2, \ldots, k\}$. (A derangement is a permutation in which no element appears in its original position.)
Call the first three people $A, B$, and $C$. Let $X \rightarrow Y$ denote that $X$ gives a gift to $Y$ and let $X \nrightarrow Y$ denote that $X$ gives a gift to anyone other than $Y$. We are fine unless we have $A \rightarrow B, B \rightarrow A$, $A \rightarrow C$, or $C \rightarrow A$. We will compute the number of ways for various things to occur, then combine it into what we want.
There are $D_{n-1}$ ways to have $A \rightarrow B \nrightarrow A$. This is because if $A \rightarrow B$, we can treat $A$ and $B$ as a single vertex, and since $B \nrightarrow A$, we have a derangement. Similarly, there are $D_{n-1}$ ways to have $B \rightarrow A \nrightarrow B$. Thirdly, there are $D_{n-2}$ ways to have $A \rightarrow B \rightarrow A$, since $D_{n-2}$ says how many ways the other $n-2$ people can exchange their gifts. So there are $2 D_{n-1}+D_{n-2}$ ways to have a conflict between $A$ and $B$.

Similarly, there are $2 D_{n-1}+D_{n-2}$ ways to have a conflict between $A$ and $C$.
Using similar arguments, we can show that there are $D_{n-2}$ ways for $B \rightarrow A \rightarrow C \nrightarrow B$ to occur and $D_{n-3}$ ways for $B \rightarrow A \rightarrow C \rightarrow B$ to occur. We get the same results when $B$ and $C$ are reversed. This gives $2 D_{n-2}+2 D_{n-3}$ ways for a conflict to occur within all three people.
By the Principle of Inclusion-Exclusion, the total number of ways to have a conflict is
(\# conflicts between $A$ and $B)+(\#$ conflicts between $A$ and $C)-(\#$ conflicts between $A, B$, and $C)$,
which evaluates to $4 D_{n-1}-2 D_{n-3}$.
Approximating $D_{n}$ as $\frac{n!}{e}$ (the actual formula is this quantity rounded to the nearest integer, so this is a great approximation), we find that the probability of no conflicts is
$1-\frac{4 D_{n-1}-2 D_{n-3}}{D_{n}} \approx 1-4\left(\frac{(n-1)!/ e}{n!/ e}\right)-2\left(\frac{(n-3)!/ e}{n!/ e}\right)=\frac{n(n-1)(n-2)-4(n-1)(n-2)-2}{n(n-1)(n-2)}$.

Substitute $m=n-1$ (this makes $m=100$, so the expression is easier to evaluate) to get a probability of

$$
\begin{gathered}
\frac{m^{3}-m-4 m^{2}+4 m-2}{m^{3}-m}=\frac{m^{3}-4 m^{2}+3 m-2}{m^{3}-m}=\frac{1,000,000-40,000+300-2}{100 \cdot 9999}=\frac{960298}{100 \cdot 9999} \\
=0.960208 \cdot(1.000100010001 \ldots)=0.960208+0.0000960208+\ldots=0.9603940 \ldots
\end{gathered}
$$

To five decimal places, the desired probability is 0.96039 .


problem:
Let $a_{1}=3$, and for $n>1$, let $a_{n}$ be the largest real number such that

$$
4\left(a_{n-1}^{2}+a_{n}^{2}\right)=10 a_{n-1} a_{n}-9
$$

What is the largest positive integer less than $a_{8}$ ?

solution:
335 Let $t_{n}$ be the larger real such that $a_{n}=t_{n}+\frac{1}{t_{n}}$. Then $t_{1}=\frac{3+\sqrt{5}}{2}$. We claim that $t_{n}=2 t_{n-1}$. Writing the recurrence as a quadratic polynomial in $a_{n}$, we have:

$$
4 a_{n}^{2}-10 a_{n-1} a_{n}+4 a_{n-1}^{2}+9=0
$$

Using the quadratic formula, we see that $a_{n}=\frac{5}{4} a_{n-1}+\frac{3}{4} \sqrt{a_{n-1}^{2}-4}$. (We ignore the negative square root, since $a_{n}$ is the largest real number satisfying the polynomial.) Substituting $t_{n-1}+\frac{1}{t_{n-1}}$ for $a_{n-1}$, we see that $\sqrt{a_{n-1}^{2}-4}=\sqrt{t_{n-1}^{2}-2+\frac{1}{t_{n-1}^{2}}}$, so we have:

$$
a_{n}=\frac{5}{4}\left(t_{n-1}+\frac{1}{t_{n-1}}\right)+\frac{3}{4} \sqrt{\left(t_{n-1}-\frac{1}{t_{n-1}}\right)^{2}}=2 t_{n-1}+\frac{1}{2 t_{n-1}}
$$

so $t_{n}=2 t_{n-1}$, as claimed. Then $a_{8}=\frac{128(3+\sqrt{5})}{2}+\frac{2}{128(3+\sqrt{5})}$. The second term is vanishingly small, so $\left\lfloor a_{8}\right\rfloor=\lfloor 64(3+\sqrt{5})\rfloor$. We approximate $\sqrt{5}$ to two decimal places as 2.24 , making this expression $\lfloor 335.36\rfloor=335$. Since our value of $\sqrt{5}$ is correct to within 0.005 , the decimal is correct to within 0.32 , which means the final answer is exact.
$13^{\text {th }}$ ANNUAL HARVARD-MIT MATHEMATICS TOURNAMENT, 20 FEBRUARY 2010 - GUTS ROUND


problem: 3000 people each go into one of three rooms randomly. What is the most likely value for the maximum number of people in any of the rooms? Your score for this problem will be 0 if you write down a number less than or equal to 1000 . Otherwise, it will be $25-27 \frac{|A-C|}{\min (A, C)-1000}$.

solution:
1019 To get a rough approximation, we can use the fact that a sum of identical random variables converges to a Gaussian distribution ${ }^{6}$ in this case with a mean of 1000 and a variance of $3000 \cdot \frac{2}{9}=667$. Since $\sqrt{667} \approx 26,1026$ is a good guess, as Gaussians tend to differ from their mean by approximately their variance.
The actual answer was computed with the following python program:

```
facts = [0]*3001
facts[0]=1
for a in range(1,3001):
    facts[a]=a*facts[a-1]
def binom(n,k):
    return facts[n]/(facts[k]*facts[n-k])
```

[^3]```
maxes = [0]*3001
M = 1075
for a in range(0,3001):
    for b in range(0,3001-a):
        c = 3000-a-b
        m = max (a,max (b,c))
        if m < M:
            maxes[m] += facts[3000]/(facts[a]*facts[b]*facts[c])
            print [a,b]
best = 1000
for a in range(1000,1050):
    print maxes[a],a
    if maxes[best] <= maxes[a]:
        best = a
print maxes[best]
print best
```

We can use arguments involving the Chernoff bound ${ }^{7}$ to show that the answer is necessarily less than 1075. Alternately, if we wanted to be really careful, we could just set $M=3001$, but then we'd have to wait a while for the script to finish.


problem: Call an positive integer almost-square if it can be written as $a \cdot b$, where $a$ and $b$ are integers and $a \leq b \leq \frac{4}{3} a$. How many almost-square positive integers are less than or equal to 1000000 ? Your score will be equal to $25-65 \frac{|A-C|}{\min (A, C)}$.

solution:
130348 To get a good estimate for the number of almost-square integers, note that any number of the form $a \cdot b$, with $b \leq \frac{4}{3} a$, will be by definition almost-square. Let's assume that it's relatively unlikely that a number is almost-square in more than one way. Then the number of almostsquare numbers less than $n$ will be approximately

$$
\sum_{a=1}^{\sqrt{n}} \sum_{b=a}^{\frac{4}{3} a} 1=\frac{1}{3} \sum_{a=1}^{\sqrt{n}} a=\frac{1}{6} \sqrt{n}(\sqrt{n}+1)
$$

which is about $\frac{n}{6}$. So, $\frac{n}{6}$ will be a fairly good estimate for the number of almost-square numbers less than $n$, making 160000 a reasonable guess.

We can do better, though. For example, we summed $\frac{a}{3}$ all the way up to $\sqrt{n}$, but we are really overcounting here because when $a$ is close to $\sqrt{n}, a \cdot b$ will be less than $n$ only when $b \leq \frac{n}{a}$, as opposed to $b \leq \frac{4 a}{3}$. So we should really be taking the sum

[^4]\[

$$
\begin{aligned}
& \sum_{a=1}^{\sqrt{\frac{3 n}{4}}} \sum_{b=a}^{\frac{4 a}{3}} 1+\sum_{a=\sqrt{\frac{3 n}{4}}}^{\sqrt{n}} \sum_{b=a}^{\frac{n}{a}} 1 \\
& \quad=\sum_{a=1}^{\sqrt{\frac{3 n}{4}}} \frac{a}{3}+\sum_{a=\sqrt{\frac{3 n}{4}}}^{\sqrt{n}}\left(\frac{n}{a}-a\right) \\
& \quad \approx \frac{1}{6} \frac{3 n}{4}+n\left(\log (\sqrt{n})-\log \left(\sqrt{\frac{3 n}{4}}\right)\right)-\left(\frac{n}{2}-\frac{3 n}{8}\right) \\
& \quad=\frac{n}{8}+n \frac{\log (4)-\log (3)}{2}-\frac{n}{8} \\
& \quad=n \frac{\log (4)-\log (3)}{2}
\end{aligned}
$$
\]

In the process of taking the sum, we saw that we had something between $\frac{n}{8}$ and $\frac{n}{6}$, so we could also guess something between 166000 and 125000 , which would give us about 145000 , an even better answer. If we actually calculate $\frac{\log (4)-\log (3)}{2}$, we see that it's about 0.14384 , so 143840 would be the best guess if we were to use this strategy. In reality, we would want to round down a bit in both cases, since we are overcounting (because numbers could be square-free in multiple ways), so we should probably answer something like 140000 .

A final refinement to our calculation (and perhaps easier than the previous one), is to assume that the products $a \cdot b$ that we consider are randomly distributed between 1 and $n$, and to compute the expected number of distinct numbers we end up with. This is the same type of problem as number 31 on this contest, and we compute that if we randomly distribute $k$ numbers between 1 and $n$ then we expect to end up with $n\left(1-\left(1-\frac{1}{n}\right)^{k}\right)$ distinct numbers. When $k=n \frac{\log (4)-\log (3)}{2}$, we get that this equals

$$
\begin{aligned}
n\left(1-\left(\left(1-\frac{1}{n}\right)^{n}\right)^{\frac{\log (4)-\log (3)}{2}}\right) & =n\left(1-\sqrt{e^{\log (3)-\log (4)}}\right) \\
& =n\left(1-\sqrt{\frac{3}{4}}\right) \\
& =n\left(1-\frac{\sqrt{3}}{2}\right) \\
& \approx 0.134 n
\end{aligned}
$$

Giving us an answer of 134000 , which is very close to the correct answer.
The actual answer was found by computer, using the following $\mathrm{C}++$ program:

```
#include <stdio.h>
using namespace std;
bool isAlmostSquare(int n){
    for(int k=1;k*k<=n;k++)
        if(n%k==0 && 3*(n/k) <= 4*k) return true;
    return false;
}
```

```
int main(){
    int c = 0;
    for(int n=1;n<=1000000;n++)
        if(isAlmostSquare(n)) c++;
    printf("%d\n",c);
    return 0;
}
```


problem:
Consider an infinite grid of unit squares. An $n$-omino is a subset of $n$ squares that is connected. Below are depicted examples of 8 -ominoes. Two $n$-ominoes are considered equivalent if one can be obtained from the other by translations and rotations. What is the number of distinct 15 -ominoes? Your score will be equal to $25-13|\ln (A)-\ln (C)|$.
![](https://cdn.mathpix.com/cropped/2025_01_24_f63473fe57314fe1b376g-15.jpg?height=185&width=684&top_left_y=840&top_left_x=761)

solution:
3426576 We claim that there are approximately $\frac{3^{n-1}}{4} n$-ominoes. First, we define an order on the squares in an $n$-omino, as follows: we order the squares from left to right, and within a column, we order the squares from top to bottom.
We construct an $n$-omino by starting with a single square and attaching squares, one by one, as close to order we just defined as possible. After the first square is placed, the next square can be attached to its bottom or right side. If the second square is right of the first, then the third square can be attached to the top, right, or bottom edges of the second. The third square cannot be attached to the first square, because the first column must be completed before the second is begun. If the second square is below the first, the third square can be attached to the bottom or right sides of the second square, or the right side of the first way. In either case, there are 3 choices for the third square.
Suppose that $m$ squares have been added, and that $k$ squares are in the right-most column right now. If $k=1$, then the next square can be attached to the top, right, or bottom side of this square. If $k>1$, then the next square can be added to the bottom or right side of the last square in this column. The next square can also be added to the right of the top square in this column, so there are still 3 choices for the next square. Therefore, there are $3^{n-1}$ ways to build up the entire $n$-omino.
Almost all $n$-omines have no rotational symmetry, so they can be built in 4 different ways by this method. This correction gives us our estimate of $\frac{3^{n-1}}{4}$ for the number of $n$-ominoes. This reasoning is not exactly correct, because some $n$-ominoes are highly non-convex, and do not admit an in-order traversal like the one described above. If some columns in the $n$-ominoes have gaps, they are not enumerated by this construction, so $\frac{3^{n-1}}{4}$ is an underestimate. We estimate that there are 1195742 15 -ominoes. The actual value of 3426576 , which can be found in the Sloane Encyclopedia of Integer Sequences, differes from the estimate by less than a factor of 3 .

[^0]:    ${ }^{1}$ See http://www-math.mit.edu/~spielman/AdvComplexity/handout.ps for an introduction to linearity of expectation and other important tools in probability

[^1]:    ${ }^{2}$ See the sections "Linear homogeneous recurrence relations with constant coefficients" and "Theorem" at http://en. wikipedia.org/wiki/Recurrence_relation
    ${ }^{3}$ See http://mathworld.wolfram.com/VietasFormulas.html

[^2]:    ${ }^{4}$ See http://en.wikipedia.org/wiki/Chinese_remainder_theorem
    ${ }^{5}$ See http://en.wikipedia.org/wiki/Fermat's_little_theorem

[^3]:    ${ }^{6}$ See http://en.wikipedia.org/wiki/Central_limit_theorem

[^4]:    ${ }^{7}$ See http://en.wikipedia.org/wiki/Chernoff_bound