Denote 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 and 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 where s 1 , s 2 ∈ Z + ∖ { 1 } (for example, U ( 6 ) = 9 and u ( 6 ) = 5 ).
Given that U ( x ) − u ( x ) = 4 9 , determine the value of x .
Clarification:
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.
There's a slight loophole in your solution.
You've pointed out that the smaller the difference d = b − a , the larger the n , and the smallest value of d occurs when d = 0 which is b = a . This is true only for even values of s , if s is odd, then b cannot be equal to a (since a and b are integers).
That means, the above method fails if x is odd, for example, let's try solving for x in U ( x ) − u ( x ) = 2 .
Using the same method as above, we will have 4 x 2 − x + 1 = 2 x 2 − 4 x − 4 = 0 This does not have an integer solution. However, x = 5 satisfies U ( x ) − u ( x ) = 2 as U ( 5 ) = 6 and u ( 5 ) = 4 (which could be easily proved by sketching).
In other words, U ( s ) = 4 s 2 is true if and only if s is even, then what is U ( s ) if s is odd? And how do you be sure that x is even? I'll let you figure those out yourself. :)
Log in to reply
It works as well. When s is odd. The smallest d is 1 and not 0. I have updated my solution above.
First of all, I claim that U ( s ) = ⎩ ⎪ ⎨ ⎪ ⎧ 4 s 2 , if s is even 4 s 2 − 1 , if s is odd 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 , the height of the grid is b , and the semiperimeter of the grid is s = a + b . Then the number of unit squares in this a × b grid is a b .
If s is even , either a ⩾ 2 s , b ⩽ 2 s or a ⩽ 2 s , b ⩾ 2 s . Without loss of generality, let's suppose that a = 2 s + d , b = 2 s − d ( d < 2 s , d ∈ Z + ∪ { 0 } ) . Then a b = ( 2 s + d ) ( 2 s − d ) = 4 s 2 − d 2 ⩽ 4 s 2 .
If s is odd , either a ⩾ 2 s + 1 , b ⩽ 2 s − 1 or a ⩽ 2 s − 1 , b ⩾ 2 s + 1 . Without loss of generality, let's suppose that a = 2 s + 1 + d , b = 2 s − 1 − d ( d < 2 s − 1 , d ∈ Z + ∪ { 0 } ) . Then a b = ( 2 s + 1 + d ) ( 2 s − 1 − d ) = 4 s 2 − 1 − d 2 ⩽ 4 s 2 − 1 .
Therefore, U ( s ) = ⎩ ⎪ ⎨ ⎪ ⎧ 4 s 2 , if s is even 4 s 2 − 1 , if s is odd . □
On the other hand, we have a b = 4 ( a + b ) 2 − ( a − b ) 2 = 4 s 2 − ( a − b ) 2 , to minimize a b , we need to minimize ( a − b ) 2 , this can be achieved with a = s − 1 , b = 1 , making a b = 4 s − ( s − 2 ) 2 = s − 1 .
Therefore, u ( s ) = s − 1 . □
Now, from U ( x ) − u ( x ) = 4 9 , we have U ( x ) − ( x − 1 ) = 4 9 ⟹ U ( x ) − x = 4 8
Since U ( x ) and x are both integers and 4 8 is even, this implies that U ( x ) , x are either both even or both odd.
Let's assume that U ( x ) and x are both odd, let x = 2 k + 1 where k is a positive integer, then U ( 2 k + 1 ) = 4 ( 2 k + 1 ) 2 − 1 = k 2 + k = k ( k + 1 )
Because k ( k + 1 ) is always even, this tells us that U ( x ) is even, but we just assumed that it was odd, a contradiction! Oh noes!
Therefore, U ( x ) and x must be both even, hence from U ( x ) − x = 4 8 , we have the following 4 x 2 − x = 4 8 ⟹ x 2 − 4 x − 1 9 2 = 0 ⟹ ( x + 1 2 ) ( x − 1 6 ) = 0
Noting that x > 0 , solving this, we get x = 1 6 .
Problem Loading...
Note Loading...
Set Loading...
Let the two sides of the grid (rectangle) be a and b , then the semiperimeter s = a + b and the number of unit squares n = a b . Without loss of generality, let us assume b ≥ a and their difference b − a = d , so that d ≥ 0 . Then, we have:
s ⟹ a ⟹ b ⟹ n = a + b = a + a + d = 2 a + d = 2 s − d = 2 s + d = a b = 2 s − d × 2 s + d = 4 s 2 − d 2 = 4 s 2 − ( b − a ) 2
This means that for a particular s the smaller the difference d = b − a , the largest the n . Since for even s (see Note for odd s ) the smallest d = 0 , when b = a , n m a x = U ( s ) = 4 s 2 . The largest d occurs when a is smallest, that is a = 1 . Since s = a + b ⟹ b = s − 1 and d = b − a = s − 2 when n is minimum. Therefore, n m i n = u ( s ) = 4 s 2 − ( s − 2 ) 2 = s − 1 .
Therefore, we have:
U ( x ) − u ( x ) 4 x 2 − x + 1 x 2 − 4 x − 1 9 2 ( x − 1 6 ) ( x + 1 2 ) ⟹ x = 4 9 = 4 9 = 0 = 0 = 1 6 since x > 0
Note: For odd s , the smallest d = 1 , when b = a + 1 . The largest d occurs when a is smallest, that is a = 1 . For example if x = 5 , for U ( 5 ) , we have b = 3 and a = 2 some that d = 1 , therefore U ( 5 ) = 6 . And for u ( 5 ) , a = 1 and b = 4 , therefore u ( 5 ) = 4 .