exam: HMMT

problem: Paul starts with the number 19. In one step, he can add 1 to his number, divide his number by 2 , or divide his number by 3 . What is the minimum number of steps Paul needs to get to 1 ?

solution: 6 One possible path is $19 \rightarrow 20 \rightarrow 10 \rightarrow 5 \rightarrow 6 \rightarrow 2 \rightarrow 1$.

solution_match: Answer:


problem: You start with a number. Every second, you can add or subtract any number of the form $n$ ! to your current number to get a new number. In how many ways can you get from 0 to 100 in 4 seconds? ( $n!$ is defined as $n \times(n-1) \times(n-2) \times \cdots \times 2 \times 1$, so $1!=1,2!=2,3!=6,4!=24$, etc.)

solution: 36 To get to 100 , you have to use one number which is at least $5!=120$, because $24 \times 4=96$, which is less than 100 . If you use $6!=720$ or anything larger, you need to get back from 720 to 100 (or further) in three seconds. Since $3 \cdot 5!<620$, there is no way to do this in 3 seconds. This means you have to use 5 ! at least once. The remaining numbers must get you from 120 to 100 . If you use three numbers all at most 3 !, you can move by at most $3 \cdot 3!=18<120-100$. This means you have to use 4 !. From $120-24=96$, there are two ways to get to 100: adding 6 then subtracting 2 , or adding 2 twice. So, to get to 100 from 0 in four seconds, you must either add 120 , subtract 24 , add 6 , and subtract 2 , or add 120 , subtract 24 , and add 2 twice. You can do these steps in any order, so the first sequence yields 24 paths and the second sequence yields 12 .


problem: Let $C$ be the circle of radius 12 centered at $(0,0)$. What is the length of the shortest path in the plane between $(8 \sqrt{3}, 0)$ and $(0,12 \sqrt{2})$ that does not pass through the interior of $C$ ?

solution: $12+4 \sqrt{3}+\pi$ The shortest path consists of a tangent to the circle, a circular arc, and then another tangent. The first tangent, from $(8 \sqrt{3}, 0)$ to the circle, has length $4 \sqrt{3}$, because it is a leg of a 30-60-90 right triangle. The $15^{\circ}$ arc has length $\frac{15}{360}(24 \pi)$, or $\pi$, and the final tangent, to $(0,12 \sqrt{2})$, has length 12.


problem: You are given a $5 \times 6$ checkerboard with squares alternately shaded black and white. The bottomleft square is white. Each square has side length 1 unit. You can normally travel on this board at a speed of 2 units per second, but while you travel through the interior (not the boundary) of a black square, you are slowed down to 1 unit per second. What is the shortest time it takes to travel from the bottom-left corner to the top-right corner of the board?

solution: $\frac{1+5 \sqrt{2}}{2}$ It is always faster to take a path around a black square than through it, since the length of the hypotenuse of any right triangle is greater than half the sum of the length of its legs. Therefore, an optimal path always stays on white squares or on boundaries, and the shortest such path has length $1+5 \sqrt{2}$.


problem:
The following grid represents a mountain range; the number in each cell represents the height of the mountain located there. Moving from a mountain of height $a$ to a mountain of height $b$ takes $(b-a)^{2}$ time. Suppose that you start on the mountain of height 1 and that you can move up, down, left, or right to get from one mountain to the next. What is the minimum amount of time you need to get to the mountain of height 49 ?

| 1 | 3 | 6 | 10 | 15 | 21 | 28 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 2 | 5 | 9 | 14 | 20 | 27 | 34 |
| 4 | 8 | 13 | 19 | 26 | 33 | 39 |
| 7 | 12 | 18 | 25 | 32 | 38 | 43 |
| 11 | 17 | 24 | 31 | 37 | 42 | 46 |
| 16 | 23 | 30 | 36 | 41 | 45 | 48 |
| 22 | 29 | 35 | 40 | 44 | 47 | 49 |

solution:
212 Consider the diagonals of the board running up and to the right - so the first diagonal is the square 1 , the second diagonal is the squares 2 and 3 , and so on. The $i$ th ascent is the largest step taken from a square in the $i$ th diagonal to a square in the $i+1$ st. Since you must climb from square 1 to square 49 , the sum of the ascents is at least 48 . Since there are 12 ascents, the average ascent is at least 4.

The 1 st and 12 th ascents are at most 2 , and the 2 nd and 11 th ascents are at most 3 . The 6 th and 7 th ascents are at least 6 , and the 5 th and 8 th ascents are at least 5 . Because $f(x)=x^{2}$ is convex, the sum of squares of the ascents is minimized when they are as close together as possible. One possible shortest path is then $1 \rightarrow 3 \rightarrow 6 \rightarrow 10 \rightarrow 14 \rightarrow 19 \rightarrow 25 \rightarrow 31 \rightarrow 36 \rightarrow 40 \rightarrow 44 \rightarrow 47 \rightarrow 49$, which has ascents of size $2,3,4,4,5,6,6,5,4,4,3$, and 2 . Thus, our answer is 212 , the sums of the squares of these ascents. There are other solutions to this problem. One alternative problem involves computing the shortest path to each square of the graph, recursively, starting from squares 2 and 3 .

## Five Guys


problem:
There are five guys named Alan, Bob, Casey, Dan, and Eric. Each one either always tells the truth or always lies. You overhear the following discussion between them:
```
Alan: "All of us are truth-tellers."
Bob: "No, only Alan and I are truth-tellers."
Casey: "You are both liars."
Dan: "If Casey is a truth-teller, then Eric is too."
Eric: "An odd number of us are liars."
```

Who are the liars?

solution: Alan, Bob, Dan, and Eric Alan and Bob each claim that both of them are telling the truth, but they disagree on the others. Therefore, they must both be liars, and Casey must be a truth-teller. If Dan is a truth-teller, then so is Eric, but then there would only be two truth-tellers, contradicting Eric's claim. Therefore, Dan is a liar, and so is Eric.


problem: Five guys are eating hamburgers. Each one puts a top half and a bottom half of a hamburger bun on the grill. When the buns are toasted, each guy randomly takes two pieces of bread off of the grill. What is the probability that each guy gets a top half and a bottom half?

solution: $\frac{8}{63}$ Say a guy is content if he gets a top half and a bottom half. Suppose, without loss of generality, that the first guy's first piece of bread is a top. Then there is a $\frac{5}{9}$ chance that his second piece of bread is a bottom. By the same reasoning, given that the first guy is content, there is a $\frac{4}{7}$ chance that the second guy is content. Given that the first two guys are content, there is a $\frac{3}{5}$ chance that the third guy is content, and so on. Our final answer is $\frac{5}{9} \cdot \frac{4}{7} \cdot \frac{3}{5} \cdot \frac{2}{3} \cdot \frac{1}{1}=\frac{8}{63}$.


problem: A single burger is not enough to satisfy a guy's hunger. The five guys go to Five Guys' Restaurant, which has 20 different meals on the menu. Each meal costs a different integer dollar amount between $\$ 1$ and $\$ 20$. The five guys have $\$ 20$ to split between them, and they want to use all the money to order five different meals. How many sets of five meals can the guys choose?

solution:
7 Suppose the meals, sorted in descending order, cost $5+x_{1}, 4+x_{2}, \ldots, 1+x_{5}$. To satisfy the conditions in the problem, the $x_{i}$ must be a non-increasing sequence of non-negative integers which sums to 5 . Therefore, there is exactly one order for each partition of 5 : order the elements of the partition from largest to smallest and use these parts as the $x_{i}$. For example, the partition $3+2$ corresponds to the order $5+3,4+2,3,2,1$. There are thus 7 orders, corresponding to the 7 partitions of 5 below.

$$
1+1+1+1+1,1+1+1+2,1+2+2,1+1+3,2+3,1+4,5
$$

These partitions yield the following seven orders:

$$
(2,3,4,5,6),(1,3,4,5,7),(1,2,4,6,7),(1,2,3,5,7)
$$

$(1,2,3,6,8),(1,2,3,5,9),(1,2,3,4,10)$


problem: Five guys each have a positive integer (the integers are not necessarily distinct). The greatest common divisor of any two guys' numbers is always more than 1 , but the greatest common divisor of all the numbers is 1 . What is the minimum possible value of the product of the numbers?

solution: 32400 Let $\omega(n)$ be the number of distinct prime divisors of a number. Each of the guys' numbers must have $\omega(n) \geq 2$, since no prime divides all the numbers. Therefore, if the answer has prime factorization $p_{1}^{e_{1}} p_{2}^{e_{2}} \ldots p_{k}^{e_{k}}$, then $e_{1}+e_{2}+\ldots+e_{k} \geq 10$. If $p^{2}$ divided any of the guys' numbers, we could divide their number by $p$ to reduce the product. Therefore we may assume $e_{i} \leq 4$ for each $i$, so the smallest possible product is $2^{4} 3^{4} 5^{2}$. This bound is achievable: give the guys the numbers $10,6,6,6$, and 15 .


problem: Five guys join five girls for a night of bridge. Bridge games are always played by a team of two guys against a team of two girls. The guys and girls want to make sure that every guy and girl play against each other an equal number of times. Given that at least one game is played, what is the least number of games necessary to accomplish this?

solution: 25 Suppose that each guy plays each girl $t$ times. Since each guy plays against two girls in one game, the total number of games each guy plays is $\frac{5 t}{2}$. Then the total number of games is $\frac{25 t}{4}$, which is a multiple of 25 and therefore at least 25 . To check that 25 games is enough, we arrange the guys and girls in two circles. A good pair of guys is a pair of guys who are adjacent in the circle; a good pair of girls is defined similarly. There are 5 good pairs of guys and girls - making each good pair of guys play each good pair of girls works.