
September 1st, 2004, 02:19 PM
#16
Re: just4fun
2 DeepButi
Sorry, I meant "8 squares but for biggest"...
Anyway, I don't think bruteforce is a subject of consideration since you are talking about n=9973...
"Programs must be written for people to read, and only incidentally for machines to execute."

September 2nd, 2004, 03:39 AM
#17
Re: just4fun
Step 1) recursive function to find a better decomposition than the actual solution.
Step 2) recursive function to arrange it. If success we have a new actual solution.
Forget about recursivity, it's nice but time consuming. It can be translated to iterations in a known way.
Reasonable guesses:
a) solution contains one (n+1)/2 and two (n1)/2
b) located at [0,0], [0,(n+1)/2] and [(n+1)/2,0]
b) implies there is always at least one 1square, so Step1 skips decompositions without 1squares.
Only non brute force trick on Step2: squares of identical size to last located (they are tried in decreasing order) only try posterior placements.
Obviously, 1squares are not tried to be placed: they fit always
So, Step2 is by far THE problem. How do you improve it? Any ideas?
Did it help? rate it.
The best conversation I had was over forty million years ago ... and that was with a coffee machine.

September 2nd, 2004, 12:29 PM
#18
Re: just4fun
One more method: greedy dynamics.
You form any decomposition, then create a temporary decomposition by cutting the area with a parrern. Pattern may be for example a square with a lower side, then you "mark" all cells on that pattern and replace them with the least number of squares, then replace with the least number of squares the remnants of squares outside the pattern cutted by it. If the resulted decomposition has a smaller number of squares, then you replace the current decomposition with the resulted, and so on. I think that the rectangles and squares with cutted (by another square) corner as patterns would be enough to reach the minimum from any starting decomposition, but I have no idea how to prove any thing like that... I'll implement my method, but at any rate it can't catch n=9973... It is (n^5) at least...
Last edited by RoboTact; September 2nd, 2004 at 12:32 PM.
"Programs must be written for people to read, and only incidentally for machines to execute."

September 3rd, 2004, 03:12 AM
#19
Re: just4fun
Just a curious pattern,
being xi the size of the ithsquare, best solutions (seem to) have:
old guess
a) x1=(n+1)/2, x2=x3=(n1)/2
more guesses
b) x4+x5=x1
c) x6=x5
d) x4 placed at [x2,nx2] i.e. top right of free area
Last edited by DeepButi; September 3rd, 2004 at 03:24 AM.
Did it help? rate it.
The best conversation I had was over forty million years ago ... and that was with a coffee machine.

September 8th, 2004, 09:19 PM
#20
Re: just4fun
Still new in this forum!u
How's this going? I go with others that said by decomposition. I think by recursion. Cut the square, then cut remaining polygons until end.
By the way,
when n = 4, how many squares?

September 9th, 2004, 03:14 AM
#21
Re: just4fun
dennisb_palma,
for any n=2*k ... allways 4 squares size k. Only prime numbers are interesting, read the whole thread .
... and I'm not on it anymore ... just working with some MTD(f) algorithms for other problems.
Did it help? rate it.
The best conversation I had was over forty million years ago ... and that was with a coffee machine.

September 13th, 2004, 03:30 AM
#22
Re: just4fun
Hi!
Prime numbers are interesting as input for this problem, but not only. Take for example n = 143. Since 11 and 13 are divisors of 143, the square can be divided as a square of 11 or 13, but which one you should choose? Both 11 and 13 squares can be devided in minimum 11 squares. Can anyone prove the following?
Theorem 1: Considering the mentioned problem's conditions, if n1 and n2 are two prime numbers such as n1 < n2, then the solution (minimum number of squares required to divide a square of side n) for n = n1 is <= than for n = n2.
The proof for the above theorem can be quite helpful in solving the problem for numbers that are not prime.
Another interesting statement that requires proof is:
Theorem 2: Considering the mentioned problem's conditions, if n is prime number, then for any valid division of this square (solution or not), the sum of sides of all squares used in the division is >= 3*n2.
Can anyone prove it? Yes? Then, how about trying to prove that the solution will add up to exactly 3*n2...
One more thing: this problem made me recall the generalized Fibonacci series, and if you want to make it more complex, just change it to a 3D problem, by having cubes instead of squares.
You'll never be bored again

January 2nd, 2005, 02:33 PM
#23
Re: just4fun
I don't know if there would be an answer after so much time, but I still wonder how this problem can be solved, how these theorems are related to original problem and how these theorems can be proved... None was advanced for a long time...
"Programs must be written for people to read, and only incidentally for machines to execute."

January 4th, 2005, 01:38 PM
#24
Re: just4fun
Why is just prime numbers interesting in this problem? Why isn't, like say 9 interesting or something? or does it fit into the group n = prime * prime ???
This sounds really interesting, This will keep me some time with pen and paper ^^
EDIT: Aha maybe I understand the thing that the nonprimes are not interesting, is it because, a square that can be divided has it's smallest number of smaller squares = the smallest divided number * 2? Okay I didn't even understand my self, example:
If I have, let's say 21 than 21 can be divided into the factors 3 and 7, the smallest factor is 3, so the smallest number of squares in a 21 square, is 3 * 2 = 6 ?
EDIT: (again) noop sorry, that was a bad statement, I think I get it now, it is not that you take the smallest factor * 2 but you take the smallest factor, and than you see how many squares fit in a square with the side of the smallest factor, okay, taht makes it really stupid to look for things that are not primes...
Last edited by Pixlegamer; January 4th, 2005 at 02:08 PM.
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules

Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.
Featured
