In town $N$ the central square hase a shape of rectangle $n \times m$, composed of squares $1 \times 1$. In order, to illuminathe the square, lanterns are placed on the corners of the tiles (including the edge of rectangle), such that every lantern illuminates all tiles in corners of which it is placed. Find the minimal amount of lanterns which can be placed, such that every tile will be illuminated even if one of the lanterns burns out.
Problem
Source: Belarusian National Olympiad 2017
Tags: combinatorics, rectangle
rcv
02.04.2017 19:08
This isn't especially elegant, but I think it gets the job done.
If $m$ and $n$ are both odd, we color the tiles such that one tile in any square $2\times 2$ block of tiles is shaded, as shown. In this coloring, one lantern, wherever it is placed, illuminates exactly one shaded tile. There are $(m+1)(n+1)/4$ shaded tiles. And since every tile must be illuminated by at least 2 lanterns, the minimum number of lanterns required is $\boxed{(m+1)(n+1)/2}.$ If we start with a shaded tile in the SW corner of your town square, and if we place a red lantern at the NE corner of each shaded tile and if we place a green lantern at the NW corner of each shaded tile, we have illuminated every tile by two lanterns, thus demonstrating a solution that achieves the theoretical minimum of $(m+1)(n+1)/2.$
Example: $7\times 3$ town square, $\tfrac{(m+1)(n+1)}{4}=\tfrac{8\times 4}{4}=8$ shaded tiles. $\rightarrow 16$ lanterns required.
[asy][asy]
size(70,70);
int m, n;
m=7; n=3;
int i,j;
i=m+1; j=n+1;
int ii, jj;
for (ii=0; ii<i; ii=ii+1) draw((ii,0)--(ii,n));
for (jj=0; jj<j; jj=jj+1) draw((0,jj)--(m,jj));
for (ii=0; ii<i-1; ii=ii+2) {
for (jj=0; jj<j-1; jj=jj+2) {
filldraw((ii,jj)--(ii+1,jj)--(ii+1,jj+1)--(ii,jj+1)--cycle,gray, black);
dot((ii+1,jj+1),red);
dot((ii,jj+1),green);
}
}
[/asy][/asy]
If one of $(m, n)$ is odd, but the other is even, we assume without loss of generality $m$ is odd and $n$ is even. We color the tiles as before. (This is almost the same as the previous case.) One lantern, wherever it is placed, illuminates exactly one shaded tile. There are $(m+1)(n)/4$ shaded tiles. And since every tile must be illuminated by at least 2 lanterns, the minimum number of lanterns required is $\boxed{(m+1)(n)/2}.$ If we start with a shaded tile in the SW corner of your town square, and if we place a red lantern at the NE corner of each shaded tile and if we place a green lantern at the NW corner of each shaded tile, we have illuminated every tile by two lanterns, thus demonstrating a solution that achieves the theoretical minimum of $(m+1)(n)/2.$
Example: $7\times 4$ town square, $\tfrac{(m+1)n}{4}=\tfrac{8\times 4}{4}=8$ shaded tiles. $\rightarrow 16$ lanterns required.
[asy][asy]
size(70,70);
int m, n;
m=7; n=4;
int i,j;
i=m+1; j=n+1;
int ii, jj;
for (ii=0; ii<i; ii=ii+1) draw((ii,0)--(ii,n));
for (jj=0; jj<j; jj=jj+1) draw((0,jj)--(m,jj));
for (ii=0; ii<i-1; ii=ii+2) {
for (jj=0; jj<j-1; jj=jj+2) {
filldraw((ii,jj)--(ii+1,jj)--(ii+1,jj+1)--(ii,jj+1)--cycle,gray, black);
dot((ii+1,jj+1),red);
dot((ii,jj+1),green);
}
}
[/asy][/asy]
For this case, we use a recursive pigeonhole argument.
[asy][asy]
size(165,165);
int m, n;
m=10; n=8;
int i,j;
i=m+1; j=n+1;
int ii, jj;
fill ((1,1)--(m-1,1)--(m-1,n-1)--(1,n-1)--cycle,mediumgray);
for (ii=0; ii<i-1; ii=ii+1) {
for (jj=0; jj<j-1; jj=jj+1) {
if (ii==0 || ii==i-2 || jj==0 || jj==j-2)
filldraw((ii,jj)--(ii+1,jj)--(ii+1,jj+1)--(ii,jj+1)--cycle,gray, black);
}
}
label("$m$",(0,0)--(m,0),S);
label("$n$",(m,0)--(m,n),E);
label("$(m-2)\times(n-2)$",(0,0)--(m,n),(0,0),fontsize(7pt));
dot((1,1),yellow);
dot((m-1,1),yellow);
dot((m-1,n-1),yellow);
dot((1,n-1),yellow);
[/asy][/asy]
For even $m$ and $n$, we assume WLOG $m\ge n$. If $m\ge n\ge 4$ we concentrate on illuminating the perimeter. The number of tiles in the perimeter is $P=2m+2n-4.$ To cast double-light on every tile in the perimeter cannot be done with fewer than $2P$ units of light, where each lantern casts up to 4 units of light, depending on how many tiles it illuminates. $2P=4m+4n-8$ is the minimum units of light to double-illuminate the perimeter.
There are four places where a single lantern can cast 3 units of light on the tiles of the perimeter (shown as yellow lanterns). All other lantern locations cast no more than 2 units of light on the tiles of the perimeter.
So, let's claim those 4 lantern locations, which reduces the number of units of light required by 12.
Assuming every remaining lantern is able to cast 2 units of light on the perimeter, we need no fewer than $\tfrac{2P-12}{2}=2m+2n-10$ additional lanterns.
The total number of lanterns required to illuminate the perimeter cannot be fewer than $2m+2n-6$.
Since I am proving a lower bound on the number of lanterns required, I can be optimistic, and assume we can find an arrangement of lanterns where the lanterns required by this recursion are also able to double-illuminate the perimeter of the rectangle just inside the one we just illuminated. (I.e., no extra lanterns are needed to illuminate the tier of tiles just inside the perimeter.) More importantly for proving a lower bound, by removing two layers of tiles, we are certain to begin the next level of recursion with the new perimeter completely unlighted.
We peel off the perimeter and the perimeter under that and apply this logic recursively to tile the perimeter of an $(m-4)\times(n-4)$ rectangle.
[asy][asy]
size(90,90);
int m, n;
m=6; n=4;
int i,j;
i=m+1; j=n+1;
int ii, jj;
fill ((0,0)--(m,0)--(m,n)--(0,n)--cycle,mediumgray);
for (ii=0; ii<i-1; ii=ii+1) {
for (jj=0; jj<j-1; jj=jj+1) {
if (ii==0 || ii==i-2 || jj==0 || jj==j-2)
filldraw((ii,jj)--(ii+1,jj)--(ii+1,jj+1)--(ii,jj+1)--cycle,gray, black);
}
}
label("$m$",(0,0)--(m,0),S);
label("$n$",(m,0)--(m,n),E);
dot((1,1),yellow);
dot((m-1,1),yellow);
dot((m-1,n-1),yellow);
dot((1,n-1),yellow);
[/asy][/asy]
If $n=0$ we're done. If $n=2$ we have another case to consider.
[asy][asy]
size(90,90);
int m, n;
m=6; n=2;
int i,j;
i=m+1; j=n+1;
int ii, jj;
fill ((0,0)--(m,0)--(m,n)--(0,n)--cycle,mediumgray);
for (ii=0; ii<i-1; ii=ii+1) {
for (jj=0; jj<j-1; jj=jj+1) {
if (ii==0 || ii==i-2 || jj==0 || jj==j-2)
filldraw((ii,jj)--(ii+1,jj)--(ii+1,jj+1)--(ii,jj+1)--cycle,gray, black);
}
}
label("$m$",(0,0)--(m,0),S);
label("$n$",(m,0)--(m,n),E);
for (ii=1; ii<i-1; ii=ii+1)
dot((ii,1),yellow);
[/asy][/asy]
For $m\ge n=2$ the logic is a little different. The number of tiles remaining is now simply $P=2m$. To cast double-light on every remaining tile cannot be done with fewer than $2P$ units of light, where each lantern casts up to 4 units of light, depending on how many tiles it illuminates. $2P=4m$ is the minimum units of light to double-illuminate the area.
This time, however, there are $m-1$ places where a single lantern can cast 4 units of light on the tiles of the perimeter (shown as yellow lanterns). All other lantern locations cast no more than 2 units of light on the tiles of the perimeter.
So, let's claim those $m-1$ lantern locations, which reduces the number of units of light required by $4m-4$.
Assuming every remaining lantern is able to cast 2 units of light, we need no fewer than $\tfrac{2P-(4m-4)}{2}=\tfrac{4m-(4m-4)}{2}=2$ additional lanterns.
The total number of lanterns required to illuminate an $m\times 2$ area cannot be fewer than $m+1$.
At this point, we have proven a minimum number of lanterns.
We still must show that such an arrangement is possible:For $n\ge 4$ we proved we needed at least 2m+2n-6 lanterns to illuminate the perimeter. Here, in the $10\times 8$ case, we show, by example, an arrangement that double-illuminates the perimeter with the proven minimum number of lanterns.
[asy][asy]
size(150,150);
int m, n;
m=10; n=8;
int i,j;
i=m+1; j=n+1;
int ii, jj;
fill ((0,0)--(m,0)--(m,n)--(0,n)--cycle,mediumgray);
//fill ((2,2)--(m-2,2)--(m-2,n-2)--(2,n-2)--cycle,lightgray);
for (ii=0; ii<i-1; ii=ii+1) {
for (jj=0; jj<j-1; jj=jj+1) {
if (ii==0 || ii==i-2 || jj==0 || jj==j-2)
filldraw((ii,jj)--(ii+1,jj)--(ii+1,jj+1)--(ii,jj+1)--cycle,gray, black);
}
}
//for (ii=1; ii<i; ii=ii+2) draw((ii,0)--(ii,n),gray);
//for (jj=1; jj<j; jj=jj+2) draw((0,jj)--(m,jj),gray);
//for (ii=0; ii<i; ii=ii+2) draw((ii,0)--(ii,n));
//for (jj=0; jj<j; jj=jj+2) draw((0,jj)--(m,jj));
for (ii=0; ii<i; ii=ii+1) {
for (jj=1; jj<j; jj=jj+2) {
if (ii<=1 || ii>=i-2 || jj==1 || jj==j-2)
dot((ii,jj),yellow);
}
}
[/asy][/asy]
For $n=2$ we proved we needed at least m+1 lanterns to illuminate the perimeter. Here, in the $6\times 2$ case, we show, by example, an arrangement that double-illuminates the perimeter with the proven minimum number of lanterns.
[asy][asy]
size(90,90);
int m, n;
m=6; n=2;
int i,j;
i=m+1; j=n+1;
int ii, jj;
fill ((0,0)--(m,0)--(m,n)--(0,n)--cycle,mediumgray);
for (ii=0; ii<i-1; ii=ii+1) {
for (jj=0; jj<j-1; jj=jj+1) {
if (ii==0 || ii==i-2 || jj==0 || jj==j-2)
filldraw((ii,jj)--(ii+1,jj)--(ii+1,jj+1)--(ii,jj+1)--cycle,gray, black);
}
}
for (ii=0; ii<i; ii=ii+1) {
for (jj=1; jj<j; jj=jj+2) {
if (ii<=1 || ii>=i-2 || jj==1 || jj==j-2)
dot((ii,jj),yellow);
}
}
[/asy][/asy]
Here is the lantern placement for multiple recursions
[asy][asy]
size(210,210);
int m, n, delta;
for (m=14, n=10, delta=0; n>0; m=m-4, n=n-4, delta=delta+2) {
int i,j;
i=m+1; j=n+1;
int ii, jj;
fill (shift(delta,delta)*((0,0)--(m,0)--(m,n)--(0,n)--cycle),mediumgray);
for (ii=0; ii<i-1; ii=ii+1) {
for (jj=0; jj<j-1; jj=jj+1) {
if (ii==0 || ii==i-2 || jj==0 || jj==j-2)
filldraw(shift(delta,delta)*((ii,jj)--(ii+1,jj)--(ii+1,jj+1)--(ii,jj+1)--cycle),gray, black);
}
}
for (ii=0; ii<i; ii=ii+1) {
for (jj=1; jj<j; jj=jj+2) {
if (ii<=1 || ii>=i-2 || jj==1 || jj==j-2)
dot(shift(delta,delta)*(ii,jj),yellow);
}
}
}
[/asy][/asy]
Let's postulate and prove a formula for the total number of lanterns required. Let $L(m,n)$ be the number of lanterns required to double-illuminate the entire city center.
Assert $L(m,n)=\frac{(m+1)(n)}{2}, m\ge n\ge 0$ for even $m, n$.
Proof by Induction:Two starting cases:
If $n=0, L(m,n)=\tfrac{1}{2}\left((m+1)(n)\right)=\tfrac{1}{2}\left((m+1)(0)\right)=0$ is true.
If $n=2, L(m,n)=\tfrac12\left((m+1)(n)\right)=\tfrac12\left((m+1)(2)\right)=m+1$ is true.
$L(m,n)=L(m-4,n-4)+(2m+2n-6)$
$=\tfrac12\left((m-3)(n-4)\right)+(2m+2n-6)$
$=\tfrac{1}{2}\left((mn-3n-4m+12)+(4m+4n-12)\right)$
$=\tfrac{1}{2}\left(mn+4n-3n+4m-4m+12-12\right)$
$=\tfrac{1}{2}\left(mn+n\right)$
$=\tfrac{1}{2}\left((m+1)(n)\right)$
So in the Even/Even case, we need a minimum of $\boxed{\frac{(m+1)(n)}{2}}$ lanterns.