Prove that a Tower of Height $H$ can be built if $H*(H+1)/2 = R + G$

40 Views Asked by At

Let us define a Red-Green Tower:

  • Each level of the red-green tower should contain blocks of the same color.
  • At every Increase in the level, number of blocks in that level is one less then previous level.

Prove that a Red-Green Tower of Height $H$ can be built if $H*(H+1)/2 = R + G$

R = total number of Red blocks in the tower.

G = total number of Green blocks in the tower.

Example:

H=4, R=4, G=6

H*(H+1)/2 = R + G

A Red-Green Tower:

(Source)

2

There are 2 best solutions below

3
On BEST ANSWER

The total number of blocks of a $H$ tower is $N(H) = \sum_{k=1}^H n = \frac{1}{2}H(H+1)$. Now you are hence saying that for any $R$, $G$ such that $R+G=N(H)$ there is a red-green tower of $H$ levels.

You can procede by induction. If $H=1$ then $N(1)=1$ and you have a single block red or green constituting your tower.

Now you have to prove that if it's true for all $H$ then it is for $H+1$.
Fix hence a $H$. Now consider $R+G=N(H+1) = \frac{1}{2}H(H+1)$. Then we can distinguish three cases.

First case: $G=0$ or $R=0$. It is trivially true.

Second case: $G\leq H+1$ or $R\leq H+1$. Let's say that $R\leq H+1$. Then you fill the $R$-th level, which is made with $R$ blocks, with all the $R$ red blocks. You fill all the other levels with the green blocks and you are done.

Third case: $G>H+1$ and $R>H+1$. Then you can fill the last layer with $H+1$ green blocks. You are left with $N(H+1)-(H+1) = N(H)$ blocks and you have to fill the first $H$ layers. It is possible by induction, since you know that there exists a green-red tower of $H$ levels every time you have $N(H)$ blocks.

Note that as @Hagen has shown in his answer, it's easy to see that these three cases are exhaustive, i.e. you're always in one of them.

1
On

Note that $$H(H+1)-4(H-1)=H^2-3H+4=(H-\tfrac32)^2+\tfrac 74>0 $$ implies $$ \frac{H(H+1)}2>2(H-1).$$ Thus $R+G=\frac{H(H+1)}2$ impies that at least one of $R,G$ is $\ge H$ and can be used for the bottom row.

From here, it should be straightforward.