Unit Squares Galore

Denote U ( s 1 ) U(s_1) as a function of the maximum number of unit squares that can be formed in a rectangular grid with semiperimeter s 1 s_1 and u ( s 2 ) u(s_2) as a function of the minimum number of unit squares that can be formed in a rectangular grid with semiperimeter s 2 s_2 where s 1 , s 2 Z + { 1 } s_1,s_2\in \mathbb Z^+\setminus\{1\} (for example, U ( 6 ) = 9 U(6)=9 and u ( 6 ) = 5 u(6)=5 ).

Given that U ( x ) u ( x ) = 49 U(x)-u(x)=49 , determine the value of x x .

Clarification:

  • Unit square is a square with side 1.

This is one part of Quadrilatorics .


The answer is 16.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Chew-Seong Cheong
Dec 29, 2016

Let the two sides of the grid (rectangle) be a a and b b , then the semiperimeter s = a + b s=a+b and the number of unit squares n = a b n=ab . Without loss of generality, let us assume b a b \ge a and their difference b a = d b-a=d , so that d 0 d \ge 0 . Then, we have:

s = a + b = a + a + d = 2 a + d a = s d 2 b = s + d 2 n = a b = s d 2 × s + d 2 = s 2 d 2 4 = s 2 ( b a ) 2 4 \begin{aligned} s & = a+b = a+a+d = 2a + d\\ \implies a & = \frac {s-d}2 \\ \implies b & = \frac {s+d}2 \\ \implies n & = ab = \frac {s-d}2 \times \frac {s+d}2 = \frac {s^2-d^2}4 = \frac {s^2-(b-a)^2}4 \end{aligned}

This means that for a particular s s the smaller the difference d = b a d =b-a , the largest the n n . Since for even s s (see Note for odd s s ) the smallest d = 0 d=0 , when b = a b=a , n m a x = U ( s ) = s 2 4 n_{max} = U(s) = \dfrac {s^2}4 . The largest d d occurs when a a is smallest, that is a = 1 a=1 . Since s = a + b b = s 1 s=a+b \implies b = s-1 and d = b a = s 2 d = b-a = s-2 when n n is minimum. Therefore, n m i n = u ( s ) = s 2 ( s 2 ) 2 4 = s 1 n_{min} = u(s) = \dfrac {s^2 - (s-2)^2}4 = s-1 .

Therefore, we have:

U ( x ) u ( x ) = 49 x 2 4 x + 1 = 49 x 2 4 x 192 = 0 ( x 16 ) ( x + 12 ) = 0 x = 16 since x > 0 \begin{aligned} U(x) - u(x) & = 49 \\ \frac {x^2}4 - x + 1 & = 49 \\ x^2 - 4x - 192 & = 0 \\ (x-16)(x+12) & = 0 \\ \implies x & = \boxed{16} & \small \color{#3D99F6} \text{since }x > 0\end{aligned}


Note: For odd s s , the smallest d = 1 d=1 , when b = a + 1 b=a+1 . The largest d d occurs when a a is smallest, that is a = 1 a=1 . For example if x = 5 x=5 , for U ( 5 ) U(5) , we have b = 3 b=3 and a = 2 a=2 some that d = 1 d=1 , therefore U ( 5 ) = 6 U(5)=6 . And for u ( 5 ) u(5) , a = 1 a=1 and b = 4 b=4 , therefore u ( 5 ) = 4 u(5) = 4 .

There's a slight loophole in your solution.

You've pointed out that the smaller the difference d = b a d=b-a , the larger the n n , and the smallest value of d d occurs when d = 0 d=0 which is b = a b=a . This is true only for even values of s s , if s s is odd, then b b cannot be equal to a a (since a a and b b are integers).

That means, the above method fails if x x is odd, for example, let's try solving for x x in U ( x ) u ( x ) = 2 U(x)-u(x)=2 .

Using the same method as above, we will have x 2 4 x + 1 = 2 x 2 4 x 4 = 0 \frac{x^2}{4}-x+1=2 \\ x^2-4x-4=0 This does not have an integer solution. However, x = 5 x=5 satisfies U ( x ) u ( x ) = 2 U(x)-u(x)=2 as U ( 5 ) = 6 U(5)=6 and u ( 5 ) = 4 u(5)=4 (which could be easily proved by sketching).

In other words, U ( s ) = s 2 4 U(s)=\frac{s^2}{4} is true if and only if s s is even, then what is U ( s ) U(s) if s s is odd? And how do you be sure that x x is even? I'll let you figure those out yourself. :)

Kenneth Tan - 4 years, 4 months ago

Log in to reply

It works as well. When s s is odd. The smallest d d is 1 and not 0. I have updated my solution above.

Chew-Seong Cheong - 4 years, 4 months ago
Kenneth Tan
Jul 12, 2018

First of all, I claim that U ( s ) = { s 2 4 , if s is even s 2 1 4 , if s is odd U(s)=\begin{cases}\dfrac{s^2}{4},\quad\text{if }s\text{ is even} \\ \dfrac{s^2-1}{4},\quad\text{if }s\text{ is odd}\end{cases} u ( s ) = s 1 u(s)=s-1

Here is a sketch of the proof, you can find the full details of this proof in my solution to I Want Me More Unit Squares and I Want Me Less Unit Squares , if you've already seen it, you can safely skip this part. :D

Proof:

Suppose the width of the grid is a a , the height of the grid is b b , and the semiperimeter of the grid is s = a + b s=a+b . Then the number of unit squares in this a × b a\times b grid is a b ab .

If s s is even , either a s 2 a\geqslant\frac{s}{2} , b s 2 b\leqslant\frac{s}{2} or a s 2 a\leqslant\frac{s}{2} , b s 2 b\geqslant\frac{s}{2} . Without loss of generality, let's suppose that a = s 2 + d a=\frac{s}{2}+d , b = s 2 d b=\frac{s}{2}-d ( d < s 2 , d Z + { 0 } ) (d<\frac{s}{2},\,d\in\mathbb{Z^+}\cup\{0\}) . Then a b = ( s 2 + d ) ( s 2 d ) = s 2 4 d 2 s 2 4 ab=\left(\frac{s}{2}+d\right)\left(\frac{s}{2}-d\right)=\frac{s^2}{4}-d^2\leqslant\frac{s^2}{4} .

If s s is odd , either a s + 1 2 a\geqslant\frac{s+1}{2} , b s 1 2 b\leqslant\frac{s-1}{2} or a s 1 2 a\leqslant\frac{s-1}{2} , b s + 1 2 b\geqslant\frac{s+1}{2} . Without loss of generality, let's suppose that a = s + 1 2 + d a=\frac{s+1}{2}+d , b = s 1 2 d b=\frac{s-1}{2}-d ( d < s 1 2 , d Z + { 0 } ) (d<\frac{s-1}{2},\,d\in\mathbb{Z^+}\cup\{0\}) . Then a b = ( s + 1 2 + d ) ( s 1 2 d ) = s 2 1 4 d 2 s 2 1 4 ab=\left(\frac{s+1}{2}+d\right)\left(\frac{s-1}{2}-d\right)=\frac{s^2-1}{4}-d^2\leqslant\frac{s^2-1}{4} .

Therefore, U ( s ) = { s 2 4 , if s is even s 2 1 4 , if s is odd U(s)=\begin{cases}\dfrac{s^2}{4},\quad\text{if }s\text{ is even} \\ \dfrac{s^2-1}{4},\quad\text{if }s\text{ is odd}\end{cases} . _\square

On the other hand, we have a b = ( a + b ) 2 ( a b ) 2 4 = s 2 ( a b ) 2 4 ab=\frac{(a+b)^2-(a-b)^2}{4}=\frac{s^2-(a-b)^2}{4} , to minimize a b ab , we need to minimize ( a b ) 2 (a-b)^2 , this can be achieved with a = s 1 a=s-1 , b = 1 b=1 , making a b = s ( s 2 ) 2 4 = s 1 ab=\frac{s-(s-2)^2}{4}=s-1 .

Therefore, u ( s ) = s 1 u(s)=s-1 . _\square

Now, from U ( x ) u ( x ) = 49 U(x)-u(x)=49 , we have U ( x ) ( x 1 ) = 49 U ( x ) x = 48 U(x)-(x-1)=49\implies U(x)-x=48

Since U ( x ) U(x) and x x are both integers and 48 48 is even, this implies that U ( x ) U(x) , x x are either both even or both odd.

Let's assume that U ( x ) U(x) and x x are both odd, let x = 2 k + 1 x=2k+1 where k k is a positive integer, then U ( 2 k + 1 ) = ( 2 k + 1 ) 2 1 4 = k 2 + k = k ( k + 1 ) U(2k+1)=\frac{(2k+1)^2-1}{4}=k^2+k=k(k+1)

Because k ( k + 1 ) k(k+1) is always even, this tells us that U ( x ) U(x) is even, but we just assumed that it was odd, a contradiction! Oh noes!

Therefore, U ( x ) U(x) and x x must be both even, hence from U ( x ) x = 48 U(x)-x=48 , we have the following x 2 4 x = 48 x 2 4 x 192 = 0 ( x + 12 ) ( x 16 ) = 0 \frac{x^2}{4}-x=48\implies x^2-4x-192=0\implies (x+12)(x-16)=0

Noting that x > 0 x>0 , solving this, we get x = 16 x=16 .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...