 |
S.O.S. Mathematics CyberBoard
|
| View previous topic :: View next topic |
| Author |
Message |
possofty S.O.S. Newbie
Joined: 05 Nov 2009 Posts: 3
|
Posted: Thu, 5 Nov 2009 16:58:11 UTC Post subject: pls help !!! Really strange question |
|
|
On a standard chessboard how many different ways can you select a block of five neighbor squares?
Two squares are neighbors if they have a common side.
(If the problem was asked for a 3x3 board the answer would be 49.)
I know a way to solve that problem but i think it is too long. i draw every possible position. then i calculate how many possiblity are there.
But my boss said me that it can be calculated to easily with a little code ( written by C,C++,C#...). So Does anybody have an idea ? (formulas, algorithm exc...)
Thank you.. |
|
| Back to top |
|
 |
Ilaggoodly Moderator

Joined: 15 Feb 2007 Posts: 687 Location: Bonn, Deutschland
|
Posted: Thu, 5 Nov 2009 17:36:04 UTC Post subject: |
|
|
You could think of the different possible shapes that arent isomorphic under rotation, and count how many of each are possible, and then consider rotating them.
Don't think thats what your "boss" had in mind though _________________
 |
|
| Back to top |
|
 |
aswoods Member of the 'S.O.S. Math' Hall of Fame

Joined: 23 Feb 2009 Posts: 524 Location: Adelaide, Australia
|
Posted: Thu, 5 Nov 2009 23:16:23 UTC Post subject: |
|
|
Suppose that you have a fixed shape to place on the chessboard. If you can't rotate it, then the number of places it can go is easy to figure out. Enclose it in the smallest possible rectangle, then work out where the rectangle can go.
For example, a 2x3 rectangle can be placed in (9-2)*(9-3) = 7*6 = 42 positions.
http://en.wikipedia.org/wiki/Pentomino
There are eighteen one-sided pentominoes. Including rotations, there are 63 different shapes to consider, but you can make the task easier by working out the positions for each of the original eighteen, then multiplying by 4, or 2, or 1, depending on how many distinct shapes are produced by rotating it. (This works because the chessboard is a square, so (9-m)*(9-n) = (9-n)*(9-m).)
If you want to write a program, the normal algorithm for counting polyominoes is described here. But I don't think it's needed. |
|
| Back to top |
|
 |
possofty S.O.S. Newbie
Joined: 05 Nov 2009 Posts: 3
|
Posted: Fri, 6 Nov 2009 07:47:19 UTC Post subject: |
|
|
so the easiest way is that i think
"There are eighteen one-sided pentominoes. Including rotations, there are 63 different shapes to consider"
Thanks for you help and giving attention to my question  |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|