Conjecture for the maximum number of rooms.

63 Views Asked by At

enter image description here

The puzzle I have is essentially this, but for $n$ rows.For this instance of $n=5$, quick tallying reveals the answer to be $21$. For $n=4$, it is $13$. For $n=3$, it is $7$. For $n=2$ it is $3$. And for $n=1$, it is obviously $1$. I conjectured a formula to calculate the maximum number of rooms: $n^2 - n +1$. I have tested this formula upto $n=7$ and it works. (I don't want to test anymore, too lazy) Now it is my understanding that all conjectures must be proven, but I don't know how to prove mine. I'm thinking induction, but as I haven't formally learnt it yet, I'm not well versed in induction. I'd appreciate it if you could show me a proof. It need not be induction. Thanks :)

1

There are 1 best solutions below

6
On BEST ANSWER

Consider coloring the triangles as follows:

enter image description here

In any path you can only move from a dark triangle to a light triangle or vice versa. In a triangle with $n$ rows there are $\sum_{k=1}^n=\frac{n(n+1)}{2}$ dark triangles and $\sum_{k=1}^{n-1}=\frac{(n-1)n}{2}$ light triangles (fewer than the number of light triangles). So the maximum theoretical length of a path is $2\cdot \frac{(n-1)n}{2}+1=(n-1)n+1=n^2-n+1$ triangles. This number is obtained by considering a path that starts at a dark triangle, then moves to light, dark, light, etc. until all $\frac{(n-1)n}{2}$ light triangles have been visited (this covers $2\cdot \frac{(n-1)n}{2}$ triangles), then finally moving to a dark triangle (hence the $+1$). After this you cannot visit any more triangles, as the dark triangle is only adjacent to light triangles, and you've already visited them all. Note this doesn't prove that such a path exists.

Combining this with your explicit construction of a path that covers $n^2-n+1$ triangles, this proves that $n^2-n+1$ is the optimal number for all $n$. This can be proved by induction. For $n=1$, there is a path of length $1=1^1-1+1$, which establishes the base case. Now suppose that for some integer $n-1$ ($n \geq 2$), the triangle of $n-1$ rows contains a path of length $(n-1)^2-(n-1)+1$ which does not visit a room more than once, and suppose additionally that the path ends in one of the bottom corners of the triangle. Add an $n$th row to the triangle, and consider extending extending the path by moving directly downward from the last triangle and straight across to the opposite corner of the bottom row. Note that we visit all of the light triangles in the bottom row, of which there are $n-1$, and all but one of the dark triangles in the bottom row, of which there are $n$. So we've added $2(n-1)$ triangles to the path. Thus the path has length $$(n-1)^2-(n-1)+1+2(n-1)=(n^2-2n+1)-n+1+1+(2n-2)=n^2-n+1.$$ So the triangle with $n$ rows has a path of length $n^2-n+1$ which visits does not visit any triangle more than once, and the path ends in one of the bottom corners of the triangle. (It's important to prove that the extended path ends in a bottom corner if we include that as part of the induction hypothesis; otherwise we may not be able to apply that method of extending the path again.)